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
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:
>
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
> 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 =
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
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
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-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
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
>
> --
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
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
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
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
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
14 matches
Mail list logo