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 =
On Aug 11, 2011, at 8:24 AM, Michael Karol wrote:
Perhaps the split() function would do.
Something like split(dfrm, 1:nrow(dfrm)) or split(dfrm, rownames(dfrm))
--
Regards,
Michael
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org
] On B
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 there
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
Yep, my R-gut was right! Thanks Jean and Greg!
--j
On Thu, Jul 28, 2011 at 1:29 PM, Jean V Adams wrote:
>
> Try this:
>
> split(dataframe, dataframe$x)
>
> Jean
>
>
> `·.,, ><(((º> `·.,, ><(((º> `·.,, ><(((º>
>
> Jean V. Adams
> Statistician
> U.S. Geological Survey
> Great Lakes Scienc
Try this:
split(dataframe, dataframe$x)
Jean
`·.,, ><(((º> `·.,, ><(((º> `·.,, ><(((º>
Jean V. Adams
Statistician
U.S. Geological Survey
Great Lakes Science Center
223 East Steinfest Road
Antigo, WI 54409 USA
From:
Jonathan Greenberg
To:
r-help
Date:
07/28/2011 03:22 PM
Subject:
[
?split
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Jonathan Greenberg
> Sent: Thursday, July 28, 2011 2:1
11 matches
Mail list logo