Try this:
sapply(names(u), function(x)u[x][u[x] =min(v[x]) u[x] = max(v[x])])
On 21/02/2008, dxc13 [EMAIL PROTECTED] wrote:
useR's,
I want to apply this function to the columns of a data frame:
u[u = range(v)[1] u = range(v)[2]]
where u is the n column data frame under
You can do:
lapply2(u, v, function(u,v) u[inRange(u, range(v))])
using two functions 'lapply2' and 'inRange' defined at bottom.
This basically does:
lapply(seq(along=u),
function(i, U, V){
u - U[[i]]
v - V[[i]]
One thing is needed:
names(v) - names(u)
PS:Thanks Mark Leeds
On 22/02/2008, Henrique Dallazuanna [EMAIL PROTECTED] wrote:
Try this:
sapply(names(u), function(x)u[x][u[x] =min(v[x]) u[x] = max(v[x])])
On 21/02/2008, dxc13 [EMAIL PROTECTED] wrote:
useR's,
I want to apply
useR's,
I want to apply this function to the columns of a data frame:
u[u = range(v)[1] u = range(v)[2]]
where u is the n column data frame under consideration and v is a data frame
of values with the same number of columns as u. For example,
v1 - c(1,2,3)
v2 - c(3,4,5)
v3 - c(2,3,4)
v -
4 matches
Mail list logo