I have a data frame d
and a function f
that takes each row of the data frame to return a data frame:
d <- data.frame(x=c(1,2,3),y=c(11,22,33))
f <- function(row){
...
return(df)
}
Now, I want to apply f
to d
(to avoid looping through f(d[k,]
of course).
apply
can´t work and putting the rows of d
in a list and using lapply
failed.
What should I do?