Dygraph sync in R not working

I am running the dygraph example presented on the next RSTUDIO help page.

http://rstudio.imtqy.com/dygraphs/gallery-synchronization.html

When I run the following code, I get separate graphs for each digran separately.

dygraph(ldeaths, main = "All", group = "lung-deaths")
dygraph(mdeaths, main = "Male", group = "lung-deaths")
dygraph(fdeaths, main = "Female", group = "lung-deaths")

I do not get synchronized charts as shown on the help page. The "group" variable "death of the lungs" is not part of the xts object. Please let me know if I am missing something basic.

thank

Pradeep

+4
source share
3 answers

. dygraph , RStudio. , github:

R- script (, myscript.R) (, d1 d2).

d1 = dygraph(ldeaths, main = "All", group = "lung-deaths")
d2 = dygraph(mdeaths, main = "Male", group = "lung-deaths")

R-markdown, source() R- script .

 {r, echo=FALSE}
 source("myscript.R")
 d1
 d2

, R-markdown html (Kint to html). echo=FALSE, - html- .

+2

( , .)

dygraph gallery ( "" Google Chrome), , html. , html. Rstudio.

dygraph() ( @schlusie SO dygraph R , ), Rstudio.

, , css, .

+1

RStudio, dygraphs, dygraphs htmltools. Yihui Xie RStudio : Yihui Xie ( ).
: , : .

R, () :

# create a list of dygraphs objects
library(dygraphs)
library(htmltools)
dy_graph <- list(
  dygraphs::dygraph(ldeaths, main = "All", group = "lung-deaths"),
  dygraphs::dygraph(mdeaths, main = "Male", group = "lung-deaths"),
  dygraphs::dygraph(fdeaths, main = "Female", group = "lung-deaths")
)  # end list

# render the dygraphs objects using htmltools
htmltools::browsable(htmltools::tagList(dy_graph))

R () :

enter image description here

0

All Articles