Returning Two graphs using a single function in r

Viewed 7135

i am trying to implement a function to plot two time series plots using a single function but it returns only one here is code what is wrong with it

visualize <- function(x) {

    x<-data.frame(x)

    x1 <- x[x$chr == 1, ]
    x2 <- x[x$chr != 1, ]

    t1<-data.frame("range"=1:nrow(x1))
    t2<-data.frame("range"=1:nrow(x2))

    t1$testsample_first<-exp(x1$testSample1)
    t1$testsample_second<-exp(x1$testSample2)


    t2$testsample_first<-exp(x2$testSample1)
    t2$testsample_second<-exp(x2$testSample2)

    dygraph(t1);dygraph(t2)
 }


(visualize(scon))

It is plotting second one only .I tried to implement by calling a second function in first but same result.

1 Answers
Related