Skip to content
Prev 326340 / 398502 Next

ggplot2

Thanks Alex but the idea is to use dput() for the data so that readers can simply copy and paste it into R and have a working dataset.  I have a very small data.frame called dd.

  Var1 Var2
1     A    1
2     B    1
3     C    1
4     A    2
5     B    2
6     C    2
7     A    3
8     B    3
9     C    3
10    A    4
11    B    4
12    C    4

Here it is the  output using dput(). If you copy it and paste it into R you will have an exact duplicate of my dataset which makes working on a problem much easier.

dd  <-  structure(list(Var1 = structure(c(1L, 2L, 3L, 1L, 2L, 3L, 1L, 
2L, 3L, 1L, 2L, 3L), .Label = c("A", "B", "C"), class = "factor"), 
    Var2 = c(1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L)), .Names = c("Var1", 
"Var2"), out.attrs = structure(list(dim = 3:4, dimnames = structure(list(
    Var1 = c("Var1=A", "Var1=B", "Var1=C"), Var2 = c("Var2=1", 
    "Var2=2", "Var2=3", "Var2=4")), .Names = c("Var1", "Var2"
))), .Names = c("dim", "dimnames")), class = "data.frame", row.names = c(NA, 
-12L))

It's also a good idea to list any packages you have loaded so that we know what non-basic functions you may be using.
I won't  know if it would be useful or not without seeing it.  Generally seeing the original data is helpful as is seeing your basic code.

Have a look at one or the other of these for some suggestions on writing to the R-help list
https://github.com/hadley/devtools/wiki/Reproducibility
 http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

John Kane
Kingston ON Canada
____________________________________________________________
FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your desktop!