Re: [R] what is wrong with this dataset?

2011-11-24 Thread Rob Griffin
I (and probably everyone who has looked at your email) have literally no clue what you are trying to do. Take a look at this first. And for your ‘question’ I assume you have tried to aggregate the data frame you have called dataset – what you have produced is a new data frame that has all

Re: [R] [OT] 1 vs 2-way anova technical question

2011-11-21 Thread Rob Griffin
the way I interpret the problem (and I may be wrong here, I don't think you have been particularly clear with your question) is that you are trying to make a factorial anova where you are trying to explain "R" as a result of A,B,C and D, and their interaction terms. so using A*B*C*D. what you sh

Re: [R] create list of names where two df contain == values

2011-11-16 Thread Rob Griffin
rop = F], mean) Rob -Original Message- From: Rob Griffin Sent: Wednesday, November 16, 2011 4:35 PM To: Dennis Murphy Cc: r-help@r-project.org Subject: Re: [R] create list of names where two df contain == values Ok, thanks for looking in to this so far, I seem to have confused you al

Re: [R] create list of names where two df contain == values

2011-11-16 Thread Rob Griffin
Wednesday, November 16, 2011 4:03 PM To: Rob Griffin Cc: r-help@r-project.org Subject: Re: [R] create list of names where two df contain == values Hi: I think you're overthinking this problem. As is usually the case in R, a vectorized solution is clearer and provides more easily understood co

[R] create list of names where two df contain == values

2011-11-16 Thread Rob Griffin
Hello again... sorry to be posting yet again, but I hadn't anticipated this problem. I am trying to now put the names found in one column in data frame 1 (lets call it df.1[,1]) in to a list from the rows where the values in df.1[,2] match values in a column of another dataframe (df.2[3]) I tr

Re: [R] correlations between columns for each row

2011-11-15 Thread Rob Griffin
F,a=174:213,b=214:253) Thanks very much both of you! Rob -Original Message- From: R. Michael Weylandt Sent: Tuesday, November 15, 2011 9:28 PM To: Rob Griffin Cc: Joshua Wiley ; r-help@r-project.org Subject: Re: [R] correlations between columns for each row Is the whole thing a data frame?

Re: [R] correlations between columns for each row

2011-11-15 Thread Rob Griffin
Error in cor(x[a], x[b], use = "complete.obs") : 'x' must be numeric This is strange, it works on your example (and you've understood what I'm trying to do perfectly), but then when I use it on the original data it comes up with the error above I've checked str() and the columns are all numeri

Re: [R] averaging between rows with repeated data

2011-11-15 Thread Rob Griffin
Thanks Michael, That second (aggregate) option worked perfectly - the first (cbind) generated averages for each row between the columns. (rather than between rows for each column). I came so close with aggregate yesterday - it is only slightly different to one my attempts (of admittedly very ma

[R] correlations between columns for each row

2011-11-14 Thread Rob Griffin
Hello fellow R-users, I’ve been mulling this problem over for some time now and have decided it is something I have to deal with but can’t, so here goes: I have a dataset (called maindata, it is 271 columns *13890 rows so I wont post the entire thing here, I’ll just explain the situation!)

Re: [R] Creating dummys in R

2011-11-10 Thread Rob Griffin
hi Paulie, Further to Sarah’s email, this will give the same sex indicator (both 0 or both 1 then samesex scores 1): samesex<-ifelse(sex==sex1,1,0) from what you have described this will give you the desired result hope that helps, Rob Robert M Griffin Department of Evolutionary Biology Evo

Re: [R] How to show classes with 0 count in table()?

2011-10-31 Thread Rob Griffin
x<-matrix(c(1,2,3,4,5,3,3,0,0,3),nrow=2,ncol=5,byrow=TRUE) x [,1] [,2] [,3] [,4] [,5] [1,]12345 [2,]33003 -Original Message- From: Leonardo Bergamini Sent: Monday, October 31, 2011 1:35 PM To: r-help@r-project.org Subject: [R] How to show