Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Understand errors when using trimmed mean inside plyr functions called from knitr #121

Open
jennybc opened this issue Oct 4, 2013 · 3 comments

Comments

@jennybc
Copy link
Owner

jennybc commented Oct 4, 2013

In homework 4, I get intermittent problems around the trimmed mean. Here's an example:
foo

The user-defined function myTrimMean() is not being found here. But this code works fine in the Console and when I compile via RStudio's Knit HTML button. It also worked fine in this very compilation, run by fileherd, in the previous R chunks. Why does this happen?

@jennybc
Copy link
Owner Author

jennybc commented Oct 4, 2013

If I define the function myTrimMean() in my active R session, then compile via fileherd(), I get a new error:

foobar

Now the problem is not being able to see jTrim.

@jennybc
Copy link
Owner Author

jennybc commented Oct 4, 2013

And then, after compiling successfully with RStudio and knit2html() ... it compiles successfully with fileherd(). I am mystified. Need to strip an example down to just taking a trimmed mean in these various ways and get to the bottom of this.

@jennybc
Copy link
Owner Author

jennybc commented Oct 4, 2013

Is there something funky about scoping and ddply() that's only exposed when using knitr?

BTW happens with hw03 as well, which has some trimmed mean stuff.

Is this thread on the knitr Google Group relevant?
https://groups.google.com/forum/#!searchin/knitr/plyr/knitr/qZKxMrhPzEY/WC0JFrXepwwJ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant