Henrique Dallazuanna wrote:
try this: apply(veh_drg_animal1[ ,c("readCount","gene_length")] ,1, function(x)stats(x[1], x[2], total=55000000))
I agree with this, that was my point in my original reply. Apply is *not* passing 2 arguments simply because you are selecting two columns of the input object, it's passing *one argument*, which is the *entire row* of the input object. You can then access them individually within the stats function, as Henrique shows.
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.