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
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
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
> 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
$
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
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
6 matches
Mail list logo