rowApply: Applies a function row-wise on any data object.

Description Usage Arguments Examples

View source: R/rowr.R

Description

Essentially functions as a MARGIN=1 apply apply but also works on data objects without 2 dimensions such as lists and vectors.

Usage

1
rowApply(data, fun, ...)

Arguments

data

any R object

fun

the function to evaluate

...

additional arguments to pass to fun

Examples

1
2
3
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)


rowr documentation built on May 19, 2017, 12:21 p.m.
Search within the rowr package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.