Dear list,
A follow up on this thread - the solution I ended up with does indeed
involve parse().
However, it does the job, and it is more efficient than what I came up with
in my other attempts.
suspicious.vowels - function(data,factors,vowelcolumn,f1,f2) {
for(currfac in
On Mar 4, 2012, at 12:20 AM, Fredrik Karlsson wrote:
Hi Michael,
No, sorry - that is neither the problem or the solution.
suspicious.vowels(pb,c(Type,Sex,Vowel),F1,F2)
Error in mean(y, na.rm = na.rm) : object 'f1' not found
Obviously you have still failed to offer reproducible code to
Hi,
Sorry all - I will provide a reproducable version of this. I am still
seeing the same problem - maybe it is due to me having to use summarize?
Anyway, here is an example (using the data set attached):
Two test functions:
insidefun - function(x){
return(x+1)
}
testfun -
Hi,
Still no data (either not attached or a format the mail server
scrubs), but I made some up. ddply seems to be a bit tricky in that
it holds off evaluating its arguments. I honestly am not sure how to
get around that---no amount of fancy footwork with eval() or quote()
is going to change the
Hi Joshua,
Yes, sorry - I attached an .rda file - maybe it was squashed.
Anyway, yes, I agree with you that the function in the present state would
not be of very much help to an end user (and your right in thinking that
this is not the end implementation of the function, just an example). I too
Well, the only part that did not work nicely was the inside function.
So you could still probably lean on ddply() for much of the work and
just append the output of your function to the ddply results or
something like that.
You might also try to think about your problem in a different way.
Hi,
On Sunday, March 04, 2012 03:28:44 PM Fredrik Karlsson wrote:
Hi Joshua,
Yes, sorry - I attached an .rda file - maybe it was squashed.
Anyway, yes, I agree with you that the function in the present state would
not be of very much help to an end user (and your right in thinking that
this
Dear list,
Sorry, but I cannot get my head around how and I could pass arguments along
to high-level functions. What I have is a function that would benefit from
me using ddply from the plyr package.
However, I cannot get the arguments passing part right.
So, this is my function:
Untested, but it might be simpler than that:
suspicious.vowels(pb,c(Type,Sex,Vowel),F1,F2)
Note that F1 is in quotes but F2 isn't.
Michael
On Sat, Mar 3, 2012 at 5:46 PM, Fredrik Karlsson dargo...@gmail.com wrote:
Dear list,
Sorry, but I cannot get my head around how and I could pass
Hi Michael,
No, sorry - that is neither the problem or the solution.
suspicious.vowels(pb,c(Type,Sex,Vowel),F1,F2)
Error in mean(y, na.rm = na.rm) : object 'f1' not found
/Fredrik
On Sat, Mar 3, 2012 at 7:04 PM, R. Michael Weylandt
michael.weyla...@gmail.com wrote:
Untested, but it might
Hi Fredrik,
A reproducible example would help. We have neither your data nor your
functions.
It is not clear to me what your problem is; I have no difficulty
passing arguments from a higher function to ddply().
mtcars[1,1] - NA
f - function(data, factors, f1) {
ddply(.data = data,
11 matches
Mail list logo