r - 如何使用 ggplot() 导出 R 中变量之间的关系
问题描述
我试图通过下面的代码确定变量“RainTomorrow”与其他变量之间的关系。但是,似乎我编码的方式并没有给我输出。如何确定 RainTomorrow 和所有其他变量的关系?
rattle::weatherAUS # to load the dataset into R
str(weather)
weather$Date <- as.Date(weather$Date)
weather$RainTomorrow <- as.factor(weather$RainTomorrow)
# exploring all the varibales
weather %>%
keep(is.numeric) %>%
gather() %>%
ggplot(aes(value)) +
facet_wrap(~ key, scales = "free") +
geom_histogram()
解决方案
rattle::weatherAUS
仅将数据打印到控制台。你需要跑weather <- rattle::weatherAUS
之后,一切都会正常工作。
推荐阅读
- php - 从服务器调用时脚本不写入文件,但在手动运行时有效
- python-3.x - 从神经网络导出输出
- webrtc - Gstreamer - Webrtc 我的管道应该被复用吗?
- c# - RPC 服务器不可用。(来自 HRESULT 的异常:0x800706BA)- Excel
- python - 即使关联的菜单项被禁用,wxpython 加速器也会触发
- arrays - 快速生成不在数组中的随机数
- vba - 选择多封电子邮件并保存特定附件
- python - YouTube 报告 API 缺少 content_owner_ad_revenue_raw_a1 表
- html - HTML表单:完成文本字段后关注复选框
- ruby-on-rails - 相同模型的两个不同值的记录