Skip to content
Prev 367176 / 398506 Next

Works outside but not inside!

Well, what happens? "Doesn't work" covers a lot of ground, and you don't
provide a reproducible example.

Also, why all the > at the beginning PDF lines? Your R prompts shouldn't
look like that when entering a function, and they make it impossible to
just cut and paste the code. Not that we have any data to try it on,
either.

However, I'm going to take a wild guess that you meant to call the argument
to the first function am rather than ams because you use an object named
the former in the function, ands  not the latter. I'm further going to
guess that you have an object named am in your workspace, so the function
is running from the console because it is silently using that object. But
from another function it can't find it.

So, your first function is not actually correct, and starting from a clean
session would have shown you that, as would the process of making a
reproducible example.

Sarah
On Wed, Feb 15, 2017 at 7:51 AM Keith S Weintraub <kw1958 at gmail.com> wrote: