Re: [R] Reshaping a data frame with a series of factors and 23 repeated measures

2010-03-30 Thread wclapham
Ista, I have looked at the reshape package and have used Œmelt¹ successfully on simpler tables. I tried it here, but have not been successful. I think I just need to gain experience. I am loving R and am having a difficult time with data structure issues. I am attaching the data set that I

Re: [R] Reshaping a data frame with a series of factors and 23 repeated measures

2010-03-30 Thread Gabor Grothendieck
Try this: cattle - read.csv(http://n4.nabble.com/attachment/1745223/0/CattleGrowth.csv;) long - reshape(cattle, dir = long, idvar = Steer.ID, varying = list(grep(Date, names(cattle)), grep(Days, names(cattle)), grep(Wt,names(cattle On Tue, Mar 30, 2010 at 9:34 AM, wclapham

Re: [R] Reshaping a data frame with a series of factors and 23 repeated measures

2010-03-30 Thread Ista Zahn
Hi Bill, Here is a reshape package version. The key thing to notice is that you have multiple pieces of information in your original column names. These can be split out using the colsplit() function: # Read in the data cattle -

[R] Reshaping a data frame with a series of factors and 23 repeated measures

2010-03-29 Thread wclapham
I have a data frame that I created using read.table on a csv spreadsheet. The data look like the following: Steer.ID stocker.trt Finish.trt Date Days Wt .. Steer.Id, stocker.trt, Finish.trt are factors-- Date, Days, Wt are data that are repeated 23 times (wide format). I want

Re: [R] Reshaping a data frame with a series of factors and 23 repeated measures

2010-03-29 Thread Ista Zahn
Hi Bill, Without an example dataset it's hard to see exactly what you need to do. But you can get started by looking at the documentation for the reshape function (?reshape), and by looking at the reshape package. The reshape package has an associated web page (http://had.co.nz/reshape/) with