在 R 中的图形中的多列中排列多个`dygraphs::dygraph()`图

问题描述 投票:0回答:1

我知道我可以用 6 个

dygraph::dygraphs()
的图来制作一个图形,这些图排列成 6 行 1 列。

library (dygraphs)
library (htmltools)
mdeaths <- structure(c(2134, 1863, 1877, 1877, 1492, 1249, 1280, 1131, 1209, 1492, 1621, 1846, 2103, 2137, 2153, 1833, 1403, 1288, 1186, 1133, 1053, 1347, 1545, 2066, 2020, 2750, 2283, 1479, 1189, 1160, 1113, 970, 999, 1208, 1467, 2059, 2240, 1634, 1722, 1801, 1246, 1162, 1087, 1013, 959, 1179, 1229, 1655, 2019, 2284, 1942, 1423, 1340, 1187, 1098, 1004, 970, 1140, 1110, 1812, 2263, 1820, 1846, 1531, 1215, 1075, 1056, 975, 940, 1081, 1294, 1341), tsp = c(1974, 1979.91666666667, 12), class = "ts")
Plot_List <- lapply(1:6, function (x) {
  dygraphs::dygraph(mdeaths)
})
htmltools::browsable(htmltools::tagList(Plot_List))

如何将这些图排列成 1 列 6 行?如何将它们排列成 2 列 3 行?

r plot time-series dygraphs
1个回答
1
投票

manipulateWidget::combineWidgets

library(dygraphs)

lungDeaths <- cbind(mdeaths, fdeaths)

Plot_List <- lapply(1:6, function (x) {
  dygraphs::dygraph(lungDeaths)
})

library(manipulateWidget)
combineWidgets(
  list = Plot_List,
  nrow = 3, ncol = 2
)
© www.soinside.com 2019 - 2024. All rights reserved.