Hello everyone... I would like to create a chart (see below), how can I do it with R? Any help, suggestion, samples... will be greatly appreciated. Thanks... Avi http://r.789695.n4.nabble.com/file/n2545921/DotChart.jpg -- View this message in context: http://r.789695.n4.nabble.com/Create-Dot-Chart-tp2545921p2545921.html Sent from the R help mailing list archive at Nabble.com.
Hi, Here are three examples for something along those lines. The first uses the package "lattice", 2 and 3 use "ggplot2". There are lots of options, and you can tweak and customize these to your hearts content. dat <- data.frame(group = factor(rep(0:1, each = 40), labels c("Control", "Treatment")), id = rep(1:20, each = 4), days = sample(1:120, 80, replace = TRUE) ) library(lattice) ## Example 1 ## dotplot(x = id ~ days, data = dat, group = group, auto.key = TRUE) library(ggplot2) ## Example 2 ## ggplot(data = dat, aes(x = days, y = id, colour = group)) + geom_point() + scale_y_continuous(breaks = unique(dat$id)) ## Example 3 ## ggplot(data = dat, aes(x = days, y = id)) + geom_point() + facet_grid(group ~ ., scales = "free") + scale_y_continuous(breaks = unique(dat$id)) Hope that helps, Josh On Sun, Sep 19, 2010 at 7:46 AM, avsha38 <AVSHALO2 at post.tau.ac.il> wrote:> > Hello everyone... > > I would like to create a chart (see below), how can I do it with R? > > Any help, suggestion, samples... will be greatly appreciated. > > Thanks... Avi > > http://r.789695.n4.nabble.com/file/n2545921/DotChart.jpg > -- > View this message in context: http://r.789695.n4.nabble.com/Create-Dot-Chart-tp2545921p2545921.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > 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. >-- Joshua Wiley Ph.D. Student, Health Psychology University of California, Los Angeles http://www.joshuawiley.com/
?dotchart perhaps. --- On Sun, 9/19/10, avsha38 <AVSHALO2 at POST.TAU.AC.IL> wrote:> From: avsha38 <AVSHALO2 at POST.TAU.AC.IL> > Subject: [R] Create Dot Chart > To: r-help at r-project.org > Received: Sunday, September 19, 2010, 10:46 AM > > Hello everyone... > > I would like to create a chart (see below), how can I do it > with R? > > Any help, suggestion, samples... will be greatly > appreciated. > > Thanks... Avi > > http://r.789695.n4.nabble.com/file/n2545921/DotChart.jpg > > -- > View this message in context: http://r.789695.n4.nabble.com/Create-Dot-Chart-tp2545921p2545921.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org > mailing list > 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. >
Hi Josh, Great samples! Thanks a lot! I ran your code and saw the Dot Chart, looks like what I need. I would like to ask for your help with applying it to my file, coming from the Theoretical world making it tough for me to apply in the Code.. attached below is part of my dataset num1 is ID variable Grouping variable = ESHKOL_tert (factor with 3 levels: 1-3) T1 - T4 are the recurrent events (time in months from index for each subject) http://r.789695.n4.nabble.com/file/n2546019/recmi_dots.jpg thanks in advance, Avi -- View this message in context: http://r.789695.n4.nabble.com/Create-Dot-Chart-tp2545921p2546019.html Sent from the R help mailing list archive at Nabble.com.
Hi Josh, Great samples! Thanks a lot! I ran your code and saw the Dot Chart, looks like what I need. I would like to ask for your help with applying it to my file, coming from the Theoretical world making it tough for me to apply in the Code.. attached below is part of my dataset num1 is ID variable Grouping variable = ESHKOL_tert (factor with 3 levels: 1-3) T1 - T4 are the recurrent events (time in months from index for each subject) http://r.789695.n4.nabble.com/file/n2546047/recmi.txt recmi.txt thanks in advance, Avi -- View this message in context: http://r.789695.n4.nabble.com/Create-Dot-Chart-tp2545921p2546047.html Sent from the R help mailing list archive at Nabble.com.