Re: [R] Create single vector after looping through multiple data frames with GREP

2010-10-10 Thread Michael Bedward
Hi Simon, The function below should do it or at least get you started... getPlotData <- function (datalist, response, times) { qdata <- sapply(datalist[times], function(df) { irow <- grepl(response, df$Response) df[irow, 2:5] } ) # qdata is a matrix with rows Q1:Q4 and

Re: [R] Create single vector after looping through multiple data frames with GREP

2010-10-10 Thread Simon Kiss
Hello all, I changed the subject line of the e-mail, because the question I''m posing now is different than the first one. I hope that this is proper etiquette. However, the original chain is included below. I've incorporated bits of both Ethan and Brian's code into the script below, but th