Skip to content
Prev 165491 / 398506 Next

filling values in a vector using smaller vector

Thank you both for such beautiful solutions.  Just what I was looking for!  I 
love the Internet, R, and the R-list!  There is so much opportunity to learn.  
In fact, looking at the replace function, I see the two solutions are the 
same:
function (x, list, values)
{
    x[list] <- values
    x
}
<environment: namespace:base>

Thanks again.  You made my day.  Have a happy holiday season.

-milton
======================
On Wednesday 24 December 2008 1:46 am, you wrote:
--------------------------
I believe the following does what is wanted:

desired <- large
desired[large] <- small


Patrick Burns
patrick at burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and "A Guide for the Unwilling S User")