Re: [R] lapply with data frame

2010-02-28 Thread Bill.Venables
below! From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of bill.venab...@csiro.au [bill.venab...@csiro.au] Sent: 01 March 2010 17:18 To: n...@smartmediacorp.com; r-help@r-project.org Subject: [ExternalEmail] Re: [R] lapply with data frame Data frames are

Re: [R] lapply with data frame

2010-02-28 Thread Bill.Venables
r-help-boun...@r-project.org] On Behalf Of Noah Silverman [n...@smartmediacorp.com] Sent: 28 February 2010 12:37 To: r-help@r-project.org Subject: [R] lapply with data frame I'm a bit confused on how to use lapply with a data.frame. For example. lapply(data, function(x) print(x)) WHAT exa

[R] lapply with data frame

2010-02-28 Thread Noah Silverman
I'm a bit confused on how to use lapply with a data.frame. For example. lapply(data, function(x) print(x)) WHAT exactly is passed to the function. Is it each ROW in the data frame, one by one, or each column, or the entire frame in one shot? What I want to do apply a function to each row in

Re: [R] lapply with data frame

2010-02-27 Thread jim holtman
> x <- read.table(textConnection("idgroupvalue + 1A3.2 + 2A3.0 + 3A3.1 + 4B5.5 + 5B6.0 + 6B6.2"), header=TRUE) > # dataframe is processed by column by lapply > lapply(x, c) $id [1] 1 2 3 4 5 6 $

Re: [R] lapply with data frame

2010-02-27 Thread David Winsemius
On Feb 27, 2010, at 9:49 PM, Noah Silverman wrote: I'm a bit confused on how to use lapply with a data.frame. For example. lapply(data, function(x) print(x)) WHAT exactly is passed to the function. Is it each ROW in the data frame, No. one by one, or each column, Yes. Dataframes are

[R] lapply with data frame

2010-02-27 Thread Noah Silverman
I'm a bit confused on how to use lapply with a data.frame. For example. lapply(data, function(x) print(x)) WHAT exactly is passed to the function. Is it each ROW in the data frame, one by one, or each column, or the entire frame in one shot? What I want to do apply a function to each row in