大家下午好, 我发现dyGraph for R这是一个了不起的工具。 我只需要绘制我的32个变量xts矩阵中的两个变量(“Lifetime.Engaged.Users”和“Lifetime.Post.Total.Reach”)。
我的问题 如下所示,即使我指定了我想要绘制的两个系列(使用 dySeries ),dyGraph也会显示所有32个变量,使图表完全不可读。 这是代码。
# Read the insights from xls export
facebook.insight <- read.xlsx(
"Facebook Insights (Post Level)",
sheetIndex = 1)
# Convert the facebook insights to a Time Series with library(xts)
facebook.insight.TimeSerie <- xts(
facebook.insight[,-7],
order.by = facebook.insight$Posted
)
# Plot the desired series that are ("Lifetime.Engaged.Users" &
#"Lifetime.Post.Total.Reach") with dyGraph package
dygraph(facebook.insight.TimeSerie, main ="Facebook Insights") %>%
dySeries(name = "Lifetime.Engaged.Users", label = "Engaged Users") %>%
dySeries(name = "Lifetime.Post.Total.Reach", label = "Post Total Reach")
总之,我该怎么做只绘制两个所需的系列(“Lifetime.Engaged.Users”&amp;“Lifetime.Post.Total.Reach” ),而不必创建33 xts数据帧?