[R] subset on data frame

2004-11-19 Thread Lei Jiang
I have a data frame. And I'd like to subset according to rownames. subset(mydataframe, rownames(mydataframe) == myrow, select = mycols) it turned out that myrow cannot be a vector. But I have multiple rows to pick. Is there a way to get around this problem?? Thank you for your help!! Lei Jiang

[R] error in file(file, r): all connections are in use

2004-05-04 Thread Lei Jiang
Hi, there. I am trying to read multiple files into R, but I got following message Error in file(file, r): All connections are in use. I clean up memory everytime I read in one file. Do i have to somehow release file connection everytime i read in one?? Thanks. Lei Department of Chemsitry

[R] mask a matrix

2005-06-10 Thread Lei Jiang
Hi, there. I have two matrix with identical dimentions. matrix A contains information of 0 and 1, and matrix B contains data. I only want the data in matrix B where matrix A has 1's. the places where matrix A has 0's, I want NA's in matrix B. How do I do that?? Thank you very much. Lei

[R] one factor multiple level anova

2005-06-17 Thread Lei Jiang
(formula, rownames, variables, varnames, extras, extranames, : invalid variable type Can you please help?? Millions of thanks. Lei Jiang Department of Chemsitry University of Washington Box 351700 Seattle, WA 98195 Phone: 206-616-6882 Fax: 206-685-8665

[R] subset dataframe based on rows

2003-01-23 Thread Lei Jiang
I want to subset the dataframe based on certain values in a row. for each row in my dataframe if ANY one value of a particular set of columns satisfies cond append a logical value true at the end of the row else append a false at the end of the row