Thanks Jorge,
That is what I was looking for.
Cheers,
James
From: Jorge Ivan Velez [mailto:jorgeivanve...@gmail.com]
Sent: 08 September 2009 18:41
To: Arnold, James
Cc: r-help@r-project.org
Subject: Re: [R] Mapping factors to a new set of factors
Hi James,
Take a look at the "recode" function
Thanks a lot Phil,
Recode is exactly what I was looking for. I managed to get my old function
working using sapply, but the performance was horrendously slow!
One other thing was that the lvls vector can only seem to be set within the
global scope of R, and local variables within a function do
Thanks Jim,
I managed to get my function to work by putting it within an sapply.
Unfortunately the performance was terrible, so I've gone with the suggestion of
other posters to use recode in the car package.
Cheers,
James
-Original Message-
From: jim holtman [mailto:jholt...@gmail.com
Hello,
I am trying to map a factor variable within a data frame to a new variable
whose entries are derived from the content of the original variable and there
are fewer factors in the new variable. That is, I'm trying to set up a
surjection.
After first thinking that this would be a common op
4 matches
Mail list logo