Thank you. Your response was enlightening.
On Tue, May 4, 2010 at 11:38 PM, Duncan Murdoch
wrote:
> On 04/05/2010 10:24 AM, Luis N wrote:
>>
>> Considering the python code:
>>
>> for k, v in d.items(): do_something(k); do_something_else(v)
>>
>> I have the following for R:
>>
>> for (i in c(1:len
On 04/05/2010 10:24 AM, Luis N wrote:
Considering the python code:
for k, v in d.items(): do_something(k); do_something_else(v)
I have the following for R:
for (i in c(1:length(d))) { do_something(names(d[i]));
do_something_else(d[[i]]) }
This does not seem seems idiomatic. What is the best w
don't you create a
data frame (or a matrix) and call apply on the columns?
Christos
> Date: Tue, 4 May 2010 23:24:11 +0900
> From: globoph...@gmail.com
> To: r-help@r-project.org
> Subject: [R] Idiomatic looping over list name, value pairs in R
>
> Considering the pyth
Considering the python code:
for k, v in d.items(): do_something(k); do_something_else(v)
I have the following for R:
for (i in c(1:length(d))) { do_something(names(d[i]));
do_something_else(d[[i]]) }
This does not seem seems idiomatic. What is the best way of doing the
same with R?
Thanks.
L
4 matches
Mail list logo