colwise2: Like 'colwise', but the returned function will return...

Description Usage Arguments Details Value Author(s)

View source: R/merge_utils.R

Description

Like colwise, but the returned function will return unaffected columns alongside affected ones if possible.

Usage

1
colwise2(.fun, .cols = true, ...)

Arguments

.fun

a function to apply to each column

.cols

either a function that tests columns for inclusion, or a quoted object giving which columns to process

...

other arguments passed on to <e2><80><98>.fun<e2><80><99>

Details

This function works like colwise except that the function it returns also returns the columns not specified by the '.cols' argument (as long as they are compatible). If the unaffected columns have a different number of rows than the affected ones, then only the affected rows will be returned. The columns will be returned in the same order as the original dataframe argument to the function.

Value

A function which accepts a dataframe as argument and applies '.fun' to each of the columns specified in '.cols'. Further arguments to the function will be passed on to '.fun'.

Author(s)

Ben Veal


vapniks/mergeutils documentation built on May 3, 2019, 4:33 p.m.