Tag: dygraphs

对于循环而言,dygraph在R中不起作用

在dygraph上有一些奇怪的行为。 当为dygraph使用for循环时,我没有得到任何结果。 library(dygraphs) lungDeaths <- cbind(mdeaths, fdeaths) for(i in 1:2){ dygraph(lungDeaths[, i]) } 另一方面,当我使用lapply我得到了预期的结果 lapply(1:2, function(i) dygraph(lungDeaths[, i])) 我实际上想在我自己的数据集上使用R Markdown的for循环,并遍历不同的列,但是即使当我使用lapply “解决方法”时,也不会绘制dygraphs R Markdown代码 — title: "Untitled" author: "dimitris_ps" date: "28 May 2015" output: html_document — “`{r} library(dygraphs) lungDeaths <- cbind(mdeaths, fdeaths) lapply(1:2, function(i) dygraph(lungDeaths[, i])) “` 而当我运行它逐列的工作 — title: "Untitled" author: "dimitris_ps" date: "28 May […]