Skip to content
Prev 43036 / 398506 Next

subset select within a function

Juli,

Check again in the help about how to use the select parameter.  You need to
pass the column name for the column of interest, not the actual column.
Also, your tmpdf will already have the column selected, so there is no need
to index the column further, at least in this toy example.  In this case, I
think you could use something like:
function(vv) {
tmpdf <- subset(mydf,select=vv)
mean(tmpdf)
}
b
14.5

Sean
On 1/21/04 6:56 AM, "juli g. pausas" <juli at ceam.es> wrote: