Hi there,
Could someone help me with the following programming problem..?
I have written a function that works for my intended purpose, but it
is quite closely tied to a particular dataframe and the names of the
variables in this dataframe. However, I'd like to use the same
function for
See the warning in ?subset.
Passing the column name of lvar is not the same as passing the 'contextual
column' (as I coin it in these circumstances).
You can solve it by indeed using [] instead.
For my own comfort, here is the relevant line from your original function:
Data.tmp - subset(Fulldf,
Thanks Nick and Juan for your replies.
Nick, thanks for pointing out the warning in subset(). I'm not sure
though I understand the example you provided -- because despite using
subset() rather than bracket notation, the original function (myfunct)
does what is expected of it. The problem I have
This should be a version that does what you want.
Because you named the variable lvarname, I assumed you were already passing
lvar instead of trying to pass lvar (without the quotes), which is in no
way a 'name'.
myfunct.better - function(subgroup, lvarname, xvarname, yvarname,
dataframe)
{
2011/4/1 Nick Sabbe nick.sa...@ugent.be:
This should be a version that does what you want.
Indeed it does, thank you very much!
Because you named the variable lvarname, I assumed you were already passing
lvar instead of trying to pass lvar (without the quotes), which is in no
way a 'name'.
5 matches
Mail list logo