Re: [R] SAS user now converting to R - Help with Transpose

2009-09-28 Thread John Kane
library(reshape) melt(dataset) # assuming dataset is a data.frame. --- On Mon, 9/28/09, baxterj wrote: > From: baxterj > Subject: [R] SAS user now converting to R - Help with Transpose > To: r-help@r-project.org > Received: Monday, September 28, 2009, 10:24 AM > > I am jus

Re: [R] SAS user now converting to R - Help with Transpose

2009-09-28 Thread Paul Hiemstra
Hi, Also take a look at cast(), melt() and recast() from the reshape package. Great and very flexible functions. cheers, Paul Daniel Malter schreef: ?reshape hth, Daniel baxterj wrote: I am just starting to code in R and need some help as I am used to doing this in SAS. I have a data

Re: [R] SAS user now converting to R - Help with Transpose

2009-09-28 Thread Corrado
I think you want to look at the command "reshape", it may solve your problem. Type ?reshape in the R console on your system. On Monday 28 September 2009 18:35:25 Gabor Grothendieck wrote: > > I have a dataset that looks like this: > > > > Chemical Well1 Well2 Well3 Well4 > > BOD 13.2 14.2 15.5 14

Re: [R] SAS user now converting to R - Help with Transpose

2009-09-28 Thread Gabor Grothendieck
There is a book called R for SAS and SPSS Users which you might want to look at. On Mon, Sep 28, 2009 at 10:24 AM, baxterj wrote: > > I am just starting to code in R and need some help as I am used to doing this > in SAS. > > I have a dataset that looks like this: > > Chemical Well1 Well2 Well3 W

Re: [R] SAS user now converting to R - Help with Transpose

2009-09-28 Thread baxterj
Thank you! That worked if I coded it like this: twelldata <- cbind(welldata$Chemical, stack(welldata, names(welldata))) names(twelldata)[names(twelldata)=="ind"] <- "WellID" Henrique Dallazuanna wrote: > > Try this: > > cbind(DF$Chemical, stack(DF, names(DF))) > > On Mon, Sep 28, 2009 at

Re: [R] SAS user now converting to R - Help with Transpose

2009-09-28 Thread Henrique Dallazuanna
Try this: cbind(DF$Chemical, stack(DF, names(DF))) On Mon, Sep 28, 2009 at 11:24 AM, baxterj wrote: > > I am just starting to code in R and need some help as I am used to doing this > in SAS. > > I have a dataset that looks like this: > > Chemical Well1 Well2 Well3 Well4 > BOD 13.2 14.2 15.5 14.

[R] SAS user now converting to R - Help with Transpose

2009-09-28 Thread baxterj
I am just starting to code in R and need some help as I am used to doing this in SAS. I have a dataset that looks like this: Chemical Well1 Well2 Well3 Well4 BOD 13.2 14.2 15.5 14.2 O2 7.8 2.6 3.5 2.4 TURB 10.2 14.6 18.5 17.3 and so on with more chemicals I would like to transpose my data s

Re: [R] SAS user now converting to R - Help with Transpose

2009-09-28 Thread Daniel Malter
?reshape hth, Daniel baxterj wrote: > > I am just starting to code in R and need some help as I am used to doing > this in SAS. > > I have a dataset that looks like this: > > Chemical Well1 Well2 Well3 Well4 > BOD 13.2 14.2 15.5 14.2 > O2 7.8 2.6 3.5 2.4 > TURB 10.2 14.6 18.5 17.3 > and so o