Venkateswara Reddy Marella (Infosys Ltd)
2017-Aug-21 06:30 UTC
[R] Help Required in looping visuals
Hi Team , I have a requirement of building set of panels in which each panel has multiple visuals based on single set of dataset values and this thing is repeated for other set of values as well. For this requirement , I am trying to use a for loop to create visuals and panel for each set of values ( like first panel should be for first set of dataset values and so on) . Do we have any available solution for this problem. Thanks, Venkat. [[alternative HTML version deleted]]
I think we need a lot more information on the problem.? read? the posting guidelines at the bottom of the email & have a look at these links. http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example Reproducibility ? Advanced R. | | | | Reproducibility ? Advanced R. | | | On Monday, August 21, 2017, 4:00:13 AM EDT, Venkateswara Reddy Marella (Infosys Ltd) via R-help <r-help at r-project.org> wrote: Hi Team , I have a requirement of building set of panels in which each panel has multiple visuals based on single set of dataset values and this thing is repeated for other set of values as well. For this requirement , I am trying to use a for loop to create visuals and panel for each set of values ( like first panel should be for first set of dataset values and so on) . Do we have any available solution for this problem. Thanks, Venkat. ??? [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]]
Hi Venkat, I must admit I don't understand what you are looking for, but maybe just store the visuals in a named lIst? Also, I have started to use nested data.frames to keep plots together with identifiers of the data sets. The nest and unnest functions are in the tidyr package. It keeps me from having to create and parse long names, and provides a nice structure. HTH Ulrik On Mon, 21 Aug 2017 at 10:00 Venkateswara Reddy Marella (Infosys Ltd) via R-help <r-help at r-project.org> wrote:> Hi Team , > > I have a requirement of building set of panels in which each panel has > multiple visuals based on single set of dataset values and this thing is > repeated for other set of values as well. > For this requirement , I am trying to use a for loop to create visuals and > panel for each set of values ( like first panel should be for first set of > dataset values and so on) . Do we have any available solution for this > problem. > > Thanks, > Venkat. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
> On 21 Aug 2017, at 09:30, Venkateswara Reddy Marella (Infosys Ltd) via R-help <r-help at r-project.org> wrote: > > Hi Team , > > I have a requirement of building set of panels in which each panel has multiple visuals based on single set of dataset values and this thing is repeated for other set of values as well. > For this requirement , I am trying to use a for loop to create visuals and panel for each set of values ( like first panel should be for first set of dataset values and so on) . Do we have any available solution for this problem. > > Thanks, > Venkat.I suspect you want to plot categorical variables in panels. Run the code below and see if it solves your problem. If not, create a minimal example as below and ask your question again. df <- data.frame(set = factor(paste0("set", rep(1:6, each = 20))), x = rnorm(120), y = rnorm(120)) library(lattice) xyplot(x~y|set, df, type = "p", as.table = TRUE) library(ggplot2) ggplot(df, aes(x = x, y = y, color = set)) + facet_wrap(~set, nrow = 2, ncol = 3) + geom_point()