On Dec 12, 2009, at 6:15 PM, Patrizio Frederic wrote:
hi Michael,
the following code should work
b <- a[match('first',names(a)): match('last',names(a))]
b[is.na(b)]<-0
This might not throw an error:
b <- apply(a[match('first',names(a)): match('last',names(a))], 1:2,
fun
hi Michael,
the following code should work
b <- a[match('first',names(a)): match('last',names(a))]
b[is.na(b)]<-0
a[match('first',names(a)): match('last',names(a))] <- b
cheers,
Patrizio
2009/12/13 Michael Scharkow :
> Dear all,
>
> I'm stuck in a seemingly trivial task that I need to perform f
Dear all,
I'm stuck in a seemingly trivial task that I need to perform for many
datasets. Basically, I want to replace NA with 0 in a specified range of
columns in a dataframe. I know the first and last column to be recoded
only by its name.
I can select the columns starting like this
a[match
3 matches
Mail list logo