Re: [R] Data Frame to list?

2014-03-10 Thread Brian Diggs
On 3/7/2014 7:41 PM, Keith S Weintraub wrote: Folks, I have a data frame as follows: foo<-structure(list(name = c("A", "B", "C"), num = c(3L, 2L, 1L)), .Names = c("name", "num"), row.names = c(NA, -3L), class = "data.frame") str(foo) 'data.frame': 3 obs. of 2 variables: $ name: chr

Re: [R] Data Frame to list?

2014-03-08 Thread Keith S Weintraub
Arun et al. Thanks, This is exactly what I need. All the best, KW -- On Mar 7, 2014, at 10:59 PM, arun wrote: > Try: > oof1 <- list() > oof1[foo$name] <- foo$num > A.K. > > > > > On Friday, March 7, 2014 10:43 PM, Keith S Weintraub wrote: > Folks, > > I have a data frame as follows: >

Re: [R] Data Frame to list?

2014-03-07 Thread arun
Try: oof1 <- list()  oof1[foo$name] <- foo$num A.K. On Friday, March 7, 2014 10:43 PM, Keith S Weintraub wrote: Folks, I have a data frame as follows: > foo<-structure(list(name = c("A", "B", "C"), num = c(3L, 2L, 1L)), .Names = > c("name", "num"), row.names = c(NA, -3L), class = "data.fra

Re: [R] Data Frame to list?

2014-03-07 Thread Richard M. Heiberger
> oof <- as.list(foo$num) > names(oof) <- foo$name > oof On Fri, Mar 7, 2014 at 10:41 PM, Keith S Weintraub wrote: > Folks, > > I have a data frame as follows: > >> foo<-structure(list(name = c("A", "B", "C"), num = c(3L, 2L, 1L)), .Names = >> c("name", > "num"), row.names = c(NA, -3L), class =

[R] Data Frame to list?

2014-03-07 Thread Keith S Weintraub
Folks, I have a data frame as follows: > foo<-structure(list(name = c("A", "B", "C"), num = c(3L, 2L, 1L)), .Names = > c("name", "num"), row.names = c(NA, -3L), class = "data.frame") > str(foo) 'data.frame': 3 obs. of 2 variables: $ name: chr "A" "B" "C" $ num : int 3 2 1 > foo name

Re: [R] Data frame to list?

2011-08-11 Thread David Winsemius
Behalf Of Jonathan Greenberg Sent: Wednesday, August 10, 2011 10:36 PM To: r-help Subject: [R] Data frame to list? R-helpers: Is there an easy way to transfer a data frame to a list, where each list element is a dataframe containing a single row from the original data frame? --j David

Re: [R] Data frame to list?

2011-08-11 Thread Michael Karol
Perhaps the split() function would do. Regards,  Michael -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jonathan Greenberg Sent: Wednesday, August 10, 2011 10:36 PM To: r-help Subject: [R] Data frame to list? R-helpers: Is

[R] Data frame to list?

2011-08-10 Thread Jonathan Greenberg
R-helpers: Is there an easy way to transfer a data frame to a list, where each list element is a dataframe containing a single row from the original data frame? --j -- Jonathan A. Greenberg, PhD Assistant Project Scientist Center for Spatial Technologies and Remote Sensing (CSTARS) Department o

Re: [R] Data frame to list?

2011-08-10 Thread Jonathan Greenberg
Answered my own question. ?split Never mind! --j On Wed, Aug 10, 2011 at 7:35 PM, Jonathan Greenberg wrote: > R-helpers: > > Is there an easy way to transfer a data frame to a list, where each > list element is a dataframe containing a single row from the original > data frame? > > --j > > --

Re: [R] Data frame to list

2011-07-28 Thread David Winsemius
On Jul 28, 2011, at 4:14 PM, Jonathan Greenberg wrote: I'm hoping this is an easy problem that I'm missing something obvious. Given: x=c(1,1,1,2,2,3,3,3) y=c(1:length(x)) dataframe=data.frame(x,y) I would like to convert this to a list for use with certain functions, where each entry of th

Re: [R] Data frame to list

2011-07-28 Thread Jonathan Greenberg
Adams > Statistician > U.S. Geological Survey > Great Lakes Science Center > 223 East Steinfest Road > Antigo, WI 54409 USA > > > From: Jonathan Greenberg To: r-help < > r-help@r-project.org> Date: 07/28/2011 03:22 PM Subject: > [R] Data frame to list > Sent b

Re: [R] Data frame to list

2011-07-28 Thread Jean V Adams
07/28/2011 03:22 PM Subject: [R] Data frame to list Sent by: r-help-boun...@r-project.org I'm hoping this is an easy problem that I'm missing something obvious. Given: x=c(1,1,1,2,2,3,3,3) y=c(1:length(x)) dataframe=data.frame(x,y) I would like to convert this to a list for use with c

Re: [R] Data frame to list

2011-07-28 Thread Greg Snow
y 28, 2011 2:14 PM > To: r-help > Subject: [R] Data frame to list > > I'm hoping this is an easy problem that I'm missing something obvious. > Given: > > x=c(1,1,1,2,2,3,3,3) > y=c(1:length(x)) > dataframe=data.frame(x,y) > > I would like to convert this

[R] Data frame to list

2011-07-28 Thread Jonathan Greenberg
I'm hoping this is an easy problem that I'm missing something obvious. Given: x=c(1,1,1,2,2,3,3,3) y=c(1:length(x)) dataframe=data.frame(x,y) I would like to convert this to a list for use with certain functions, where each entry of the list is a subsetted dataframe based on dataframe$x I can d