Skip to content
Prev 310424 / 398506 Next

R function data variable name argument

Hi,

If you move the read.csv statement outside the function and instead
pass the data as an argument, then you can provide a reproducible
example using dput(head(drugs, 20)) or a similar fake dataset. It's
really hard to debug code without knowing what kind of data it is
supposed to act upon.

In the meantime, have you tried running the code line by line outside
the function to see what happens at each step, including setting the
loop variable to 1, 2, 3, etc and seeing what happens?

Sarah

On Fri, Nov 9, 2012 at 12:38 PM, Le Lait, Marie-Claire
<Marie-Claire.LeLait at rmpdc.org> wrote:
--
Sarah Goslee
http://www.functionaldiversity.org