rowApply | R Documentation |
Essentially functions as a MARGIN=1
apply
apply but also
works on data objects without 2 dimensions such as lists and vectors.
rowApply(data, fun, ...)
data |
any |
fun |
the function to evaluate |
... |
additional arguments to pass to |
rowApply(list(1,2,3),function (x) sum(unlist(x)))
df<-data.frame(a=c(1,2,3),b=c(1,2,3))
rowApply(df,sum)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.