[R] Indexing within by statement - different coloured lines in abline wanted..

2013-05-27 Thread Tom Wilding
Dear R-list I'm trying to get each regression line, plotted using abline, to be of a different colour as the following code illustrates. I'm hoping there is a simple indexing solution. Many thanks. ## code from here colours=c("black","red","blue","green","pink") Mean=500;Sd=10;NosSites=5;Xaxi

[R] Power analysis in hierarchical models

2011-09-05 Thread Tom Wilding
el2 - the ‘mer’ object doesn’t seem to contain the t values but maybe I’m missing something). Direction to any more generic sources of information regarding power analysis in hierarchical models would be gladly received. Thank you Tom. --

[R] Multifactor boxplots

2011-07-29 Thread Tom Wilding
Dear All I would like to produce interaction boxplots and this seems to work: par(mfrow=c(2,2)) A=sample(rnorm(50,50,10)) B=sample(rnorm(50,100,10)) Test=merge(A,B,by=0)#by=0 where 0 is the row.names TreatA=(gl(2,50,100,labels=c("High","Low"))) TreatB=rep(gl(2,25,50,labels=c("High","Low")),2) Ne

[R] Random selection from a subsample

2010-12-19 Thread Tom Wilding
Dear Mailing List I have a data set (data4) consisting of a number of factors and a response variable. I wish to randomly sample from a combination of two of those factors (GIS_station and Distance_code2) and return a new dataframe containing the original data structure (i.e. all the columns)