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 of Land, Air and Water Resources University of California, Davis One Shields Avenue Davis, CA 95616 Phone: 415-763-5476 AIM: jgrn307, MSN: jgrn307 at hotmail.com, Gchat: jgrn307
Answered my own question. ?split Never mind! --j On Wed, Aug 10, 2011 at 7:35 PM, Jonathan Greenberg <greenberg at ucdavis.edu> 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 > > -- > Jonathan A. Greenberg, PhD > Assistant Project Scientist > Center for Spatial Technologies and Remote Sensing (CSTARS) > Department of Land, Air and Water Resources > University of California, Davis > One Shields Avenue > Davis, CA 95616 > Phone: 415-763-5476 > AIM: jgrn307, MSN: jgrn307 at hotmail.com, Gchat: jgrn307 >-- Jonathan A. Greenberg, PhD Assistant Project Scientist Center for Spatial Technologies and Remote Sensing (CSTARS) Department of Land, Air and Water Resources University of California, Davis One Shields Avenue Davis, CA 95616 Phone: 415-763-5476 AIM: jgrn307, MSN: jgrn307 at hotmail.com, Gchat: jgrn307
Perhaps the split() function would do. Regards,? Michael -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at 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 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 of Land, Air and Water Resources University of California, Davis One Shields Avenue Davis, CA 95616 Phone: 415-763-5476 AIM: jgrn307, MSN: jgrn307 at hotmail.com, Gchat: jgrn307 ______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
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-bounces at r-project.org [mailto:r-help-bounces at 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 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? > > --jDavid Winsemius, MD West Hartford, CT