[R] Output pairwise.t.test to data.frame

2009-10-26 Thread Sam Player
# I'm doing a pairwise.t.test on a large dataset and need the output in a data frame so I can work further with it, e.g. so I can export it to a spreadsheet. Is there any way to coerce the results to an exportable format? # For example, if I do: test <- pairwise.t.test(numbers, factors, p.adj="bo

[R] Plot factors with a loop

2009-09-20 Thread Sam Player
g overwritten so that two boxplots are displayed in the plot. The result I need is also produced by: boxplot(df[df$f=="a",2], df[df$f=="b",2]) # but I need it to be done through the loop. Thanks in advance! # Sam -- Sam Player, B.Sc.(Hons.) B.A. Ph.D. Candidate, Faculty of A

[R] Counting observations of a combined factor

2009-09-19 Thread Sam Player
treat the levels of factor f3 discreetly, instead giving all possible combinations of f1 and f2. count3 <- as.data.frame(table(df2$f3)) count3 # Var1 Freq #1 a.c6 #2 b.c0 #3 a.d0 #4 b.d6 I need the results to be: # Var1 Freq #1a6 #2b6 # Any suggestions

[R] Creating histograms from factors using a for loop

2009-09-19 Thread Sam Player
levels(df[,"f"])){ y <- df[df$f==i, 2] jpeg(filename=(levels(df[i,"f"]))) hist(y, main=levels(df[i,"f"])) dev.off() } # I'm obviously not understanding how loops work with factors. Can anybody point me in the righ

[R] Grouping stripchart markers

2009-02-14 Thread Sam Player
If I have a dataset grouped into 3 classes, how can I construct a stripchart where the markers are different for each class, e.g. a cross for 1, square for 2 and circle for 3. In the example below I try to define the marker type by the class but this only changes all the markers from the defaul