【发布时间】:2018-06-01 19:25:36
【问题描述】:
我想用我的my data file 创建一个简单的高线图线图。 所以首先我更改了我的数据,以便 R 识别日期和时间。
library("tidyverse")
library("ggplot")
library("highcharter")
Moisture_kurokawa <- read_csv("~/Data/Moisture kurokawa.csv")
mutate(Moisture_kurokawa,
timestamp = lubridate::mdy_hms(sprintf("%s %s", Date, Time))) %>%
select(-Date, -Time) %>%
gather(W, value, -timestamp) -> moisture_long
所以在此之后我尝试创建一个简单的高图,所以我尝试了
hchart(moisture_long, "line", hcaes(x = timestamp, y = value, group = W))
我得到了图表,但它说没有要显示的数据。任何帮助将不胜感激。
谢谢。
结果图片:
【问题讨论】:
-
不应该是ggplot2吗?另外,你的 mutate 命令给我一个错误:
Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘select’ for signature ‘"tbl_df"’ In addition: Warning message: 24 failed to parse.
标签: r ggplot2 highcharts tidyverse