[R] one factor multiple level anova

2005-06-17 Thread Lei Jiang
I am having trouble figuring out this one.

I want to do a one way anvoa with 13 levels. mydata is in a vector with 
length 65. each level has 5 repeats. but it contains NA.

I made mygroup-gl(13, 5, 65, labels=(...))

anova(lm(mydata ~ mygroup))

it gives following error:
Error in model.frame(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-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[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 Jiang

Department of Chemsitry
University of Washington
Box 351700
Seattle, WA 98195
Phone: 206-616-6882
Fax: 206-685-8665

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[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
Department of Chemsitry
University of Washington
Box 351700
Seattle, WA 98195
Phone: 206-616-6882
Fax: 206-685-8665
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[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
University of Washington
Box 351700
Seattle, WA 98195
Phone: 206-616-6882
Fax: 206-685-8665

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[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

in the end I want to be able to subset the whole data based on the
appended true or false value.

I could literally code like this, but I think there must be a better way
to do this. Can someone give me a hint?? thanks.

Lei

Department of Chemsitry
University of Washington
Box 351700
Seattle, WA 98195
Phone: 206-616-6882
Fax: 206-685-8665

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help