Another Newbie Question sorry:

I am trying to apply a function a dataframe and could use some help:


Assuming, dim(df) = (10,2) say, I would like to apply a function that looks
at each row in turn and returns a list (dim =(10,1)) using the columns as
inputs to the function, but with no INDEX stuff that the by() function
refers to.

For a simple function x+y I know in Mathematica it would be this;

Table[df[[i,1]]+ df[[i,2]],{i,1,10}]

Of if the function was defined is would read;

Table[f[df[[i,1]], df[[i,2]]],{i,1,10}]

Thanks for help in advance

Glenn





        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to