Re: [R] flexible approach to subsetting data

2013-07-25 Thread arun
shape(rtNew,direction="long",varying=1:ncol(rtNew),sep="_",timevar="m") A.K. - Original Message - From: arun To: Andrea Lamont Cc: R help ; David Carlson Sent: Wednesday, July 24, 2013 11:53 PM Subject: Re: [R] flexible approach to subsetting data Hi, I

Re: [R] flexible approach to subsetting data

2013-07-24 Thread arun
ew)),V3=grepl("V3",names(rtNew)),V4=grepl("V4",names(rtNew)), V5=grepl("V5",names(rtNew)),V6=grepl("V6",names(rtNew)),V7=grepl("V7",names(rtNew)), v.names=c("V1","V2","V3","V4","V5","V6"

Re: [R] flexible approach to subsetting data

2013-07-24 Thread Andrea Lamont
rection="long", v.names=c("dose", "resp"), > varying=list(dose=grepl("dose", names(df5)), > resp=grepl("resp", names(df5)) ) > ) > > ------------- > David L Carlson > Associate Prof

Re: [R] flexible approach to subsetting data

2013-07-24 Thread Andrea Lamont
50 2 5 1 5 3 5 > > -- > David. > > > - > > David L Carlson > > Associate Professor of Anthropology > > Texas A&M University > > College Station, TX 77840-4352 > > > >

Re: [R] flexible approach to subsetting data

2013-07-23 Thread David Winsemius
Anthropology > Texas A&M University > College Station, TX 77840-4352 > > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of David > Winsemius > Sent: Tuesday, July 23, 2013 1:12 PM > To: David Wins

Re: [R] flexible approach to subsetting data

2013-07-23 Thread David Carlson
iginal Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius Sent: Tuesday, July 23, 2013 1:12 PM To: David Winsemius Cc: R help; Andrea Lamont Subject: Re: [R] flexible approach to subsetting data On Jul 23, 2013, at 10:49 AM, David Winsem

Re: [R] flexible approach to subsetting data

2013-07-23 Thread arun
From: arun To: Andrea Lamont Cc: R help Sent: Tuesday, July 23, 2013 12:04 PM Subject: Re: [R] flexible approach to subsetting data Sorry, a mistake It should be: res<-reshape(df1,sep=".",varying=list(c("sim","sim.1"),c("X1","X1.1"),c("

Re: [R] flexible approach to subsetting data

2013-07-23 Thread arun
)<- 1:nrow(res) head(res,2) #  m sim X1 X2 X3 #1 1   1  5  4  5 #2 1   1  4  3  2 A.K. - Original Message - From: arun To: Andrea Lamont Cc: R help Sent: Tuesday, July 23, 2013 12:00 PM Subject: Re: [R] flexible approach to subsetting data Hi, It is better to provide a reproducibl

Re: [R] flexible approach to subsetting data

2013-07-23 Thread arun
5.1 1   2  7  8  5 6.1 1   2  9  6  6 1.2 2   1  4  3  1 2.2 2   1  7  4  2 3.2 2   1  5  8  3 4.2 2   2  3  9  4 5.2 2   2  5  4  5 6.2 2   2  9  5  6   A.K. ----- Original Message ----- From: Andrea Lamont To: r-help@r-project.org Cc: Sent: Tuesday, July 23, 2013 10:35 AM Subject: [R] flexib

Re: [R] flexible approach to subsetting data

2013-07-23 Thread David Winsemius
On Jul 23, 2013, at 10:49 AM, David Winsemius wrote: > > On Jul 23, 2013, at 10:01 AM, Adams, Jean wrote: > >> Check out the reshape() function of the reshape package. Here's one of the >> examples from ?reshape. >> >> Jean >> >> >> library(reshape) # No, at least not for the reshape-fun

Re: [R] flexible approach to subsetting data

2013-07-23 Thread David Winsemius
On Jul 23, 2013, at 10:01 AM, Adams, Jean wrote: > Check out the reshape() function of the reshape package. Here's one of the > examples from ?reshape. > > Jean > > > library(reshape) # No, at least not for the reshape-function The reshape function is from the 'base' package. The 'reshape

Re: [R] flexible approach to subsetting data

2013-07-23 Thread Adams, Jean
Check out the reshape() function of the reshape package. Here's one of the examples from ?reshape. Jean library(reshape) wide <- reshape(Indometh, v.names="conc", idvar="Subject", timevar="time", direction="wide") long <- reshape(wide, direction="long") wide long On Tue, Jul 23, 2013 at 9:35

[R] flexible approach to subsetting data

2013-07-23 Thread Andrea Lamont
Hello: I am running a simulation study and am stuck with a subsetting problem. Here is the basic issue: I generated data and am running a simulation that uses multiple imputation. For each generated dataset, I used multiple imputation. The resultant dataset is in wide for where each imputation i