pmapply: Apply a function between pairs of vectors

Description Usage Arguments Value Examples

View source: R/pmapply.R

Description

Apply a function between pairs of vectors

Usage

1
pmapply(x, FUN = function(x, y) sum(x %in% y), show = "all")

Arguments

x

a list or data frame

FUN

the function to be applied between all possible pairs of vectors passed to ...

show

Whether to display upper or lower triangle of values–either 'all', 'upper', or 'lower'

Value

a matrix

Examples

1
2
3
4
5
samples <- replicate(3, sample(LETTERS, 20, replace = TRUE))
l <- list(samples[,1], samples[,2], samples[,3])
pmapply(l)
pmapply(iris[,c(1:4)], function(x, y) cor(x, y))
pmapply(iris[,c(1:4)], function(x, y) sum(x < y))

daranzolin/pmapply documentation built on Nov. 4, 2019, 9:39 a.m.