Re: [R] R function data variable name argument

2012-11-09 Thread Sarah Goslee
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

[R] R function data variable name argument

2012-11-09 Thread Le Lait, Marie-Claire
Hello fellow R-ers, I have spent some time on this and it is driving me NUTS! I am sure there is a solution, so please help. I am trying to create a function that will plot different lines for subsets of a dataset. For example, I am trying to look at different drug groups (drug2), let's say 1,2