[R] apply a function to loop through

2007-07-17 Thread Hai Lin
Dear R users, I have a dataset generated as follows, myDat <- data.frame(matrix(c(rep(LETTERS[1:3], each=5), rnorm(5,mean=3,sd=0.03), rnorm(5,12,1), rnorm(5,1,0.5)), ncol=2,

Re: [R] anova for the objects of list

2006-06-05 Thread Hai Lin
[[x]]) } ) --- Hai Lin <[EMAIL PROTECTED]> wrote: > Dear R experts, > > I have two list objects from runing lme model for > each > subjects. And my.x is the full model with all terms > I > am interested in an

[R] anova for the objects of list

2006-06-05 Thread Hai Lin
Dear R experts, I have two list objects from runing lme model for each subjects. And my.x is the full model with all terms I am interested in and my.x1 is the null model with only intercept. I am trying to compare two models at each subject level. (Doing anova(my.x[[1]], my.x1[[1]]) is to produce

[R] F-statistic in lme

2006-05-05 Thread Hai Lin
Dear R users, Are there any ways I could obtain F-statistic in lme just as I extract from summary(lm)$fstatistic? I looked up in summary(lme) and anova(lme), but i did not see it. Am I asking non-existing question? Best regards. Kevin __ R-help@stat.

Re: [R] Sending messages twice to R-help {was ... lmList error ...}

2005-10-04 Thread Hai Lin
Hello Martin and R users, Thanks for your advice. Sorry disturbing some of you. Kevin --- Martin Maechler <[EMAIL PROTECTED]> wrote: > >>>>> "Hai" == Hai Lin <[EMAIL PROTECTED]> > >>>>> on Tue, 4 Oct 2005 08:26:31 -0700 (PDT) &

[R] lmList error message

2005-10-04 Thread Hai Lin
It seems a problem sending this out. I am resending it. Hello Rs, After running lmList, I've gotten an error message "Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : NA/NaN/Inf in foreign function call (arg 4)" I'm not able to understand what it means. Could anyone help

[R] lmList error message

2005-10-03 Thread Hai Lin
Hello Rs, After running lmList, I've gotten an error message "Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : NA/NaN/Inf in foreign function call (arg 4)" I'm not able to understand what it means. Could you help me with it? The group varaible is reporterID. Thank

[R] ylab on secondary y axis

2005-06-09 Thread Hai Lin
Dear R users: I am trying to add a label on axis(4) but I don't find any reference in R archives. Could you please help me out? Thanks in advance. The followings are the data set and what I have done: Sample data: time y1 y2 2 9 24.396 4 7.667 19.082 10 4.667 73.984 C

[R] read.delim2 regarding "#"

2005-05-31 Thread Hai Lin
Hello R experts: When I tried to read my data into R, it does not take # sign A subset of Exp.txt is: Experiment name assay id Varname (A1)DBA TPA 6h/DBA Acetone rep1(A1) #3 4090A90C1 (A2)DBA TPA 6h/DBA Acetone rep2(A2) #3 4091A91C1 The command is: Exp <- read.delim2("Exp.tx

[R] Converting pc files to unix

2005-05-03 Thread Hai Lin
Hello R users, I have R script files writen in my pc laptop. I encountered problems when I run those files in R in Mac OS X (10.3.5). Are there any ways in R that can make .R files executable? Thanks in advance Kevin __ [[altern

[R] functions(t.test) on variables by groups

2005-04-12 Thread Hai Lin
Dear R users, I have a data frame with categorical Vars. "Groups" and a couple columns of numeric Vars. I am trying to make two-sample t.test on each variable(s01-s03) by Groups. A data generated as following: zot <- data.frame(Groups=rep(letters[1:2], each=4), s01=rnorm(8), s02=rnorm(8), s03=r

[R] Re: follow up on "pairewise plots"

2005-03-29 Thread Hai Lin
--- Dimitris Rizopoulos <[EMAIL PROTECTED]> wrote: > you could try something like this: > > dat <- array(sample(24), dim=c(4,2,3)) > par(mfrow=c(3,1)) > apply(dat, 3, function(x) plot(rowSums(x), > x[,2]-x[,1])) ## Thank you all for the inputs. It's great of help. The above solution also opens

[R] pairewise plots

2005-03-29 Thread Hai Lin
Dear R users, I have a data generated as the following, dat <- data.frame(matrix(sample(24), nrow=4)) dimnames(dat) <-list(rownames=c('g1','g2','g3','g4'), colnames=c("A_CH1","A_CH2","B_CH1","B_CH2","C_CH3","C_CH3")) ยป dat A_CH1 A_CH2 B_CH1 B_CH2 C_CH3 C_CH3 g11624 7 9