[R] speeding up regressions using ddply

2010-09-22 Thread Alison Macalady
the computations. require(pplyr) output<-dddply(xm, .(variable), as.data.frame.function(h)) output I can easily do this using ddply when I only want to use 1 variable in the model, but can't figure out how to do it with two variables. Many thanks for any hints! Ali ---

[R] plotting time series using ggplots

2010-09-15 Thread Alison Macalady
d by another variable (for example site), but I can't figure out how to get ggplot to plot all of the columns as Y data, without specifying each separate timeseries with a distinct +geom_line(aes(y="columnname"). Any suggestions on either problem would be greatly appreciated! ~Al

[R] change order of plot panels in faceted ggplot/qplot

2010-08-23 Thread Alison Macalady
Hi, I have a 5-paneled figure that i made using the facet function in qplot (ggplot). I've managed to arrange the panels into two rows/ three columns, but for the sake of easy visual comparisons between panels in my particular dataset, I want to have the two plots on the bottom align on t

[R] t.tests on a data.frame using an apply-type function

2010-08-21 Thread Alison Macalady
I have a data.frame with ~250 observations (rows) in each of ~50 categories (columns). I would like to perform t.tests on subsets of observations within each column, with the subsets according to index vectors contained in other columns of the data.frame. My data.frame looks something like

[R] Combining multiple datasets

2008-08-21 Thread Alison Macalady
Hi, I've tried to figure this out using Intro to R and help(), to no avail - I am new at this. I'm trying to write a script that will read multiple files from a directory and then merge them into a single new data frame. The original data are in a tree-ring specific format, and so I've first