Learn R Programming

soundcorrs (version 0.1.1)

lapplyTest: Apply a function to a list.

Description

Takes a list and applies to each of its elements a function, returning a list of outputs. Primary intended for tests of independence on a list of contingency tables.

Usage

lapplyTest(x, fun = chisq.test, ...)

Arguments

x

[list] The list to which to apply fun.

fun

[function] The function which to apply to data. Must return an object containing an element named p.value. Defaults to chisq.test.

...

Additional arguments passed to fun.

Value

[list.lapplyTest] A list of outputs of fun.

Examples

Run this code
# NOT RUN {
dataset <- sampleSoundCorrsData.abc
lapplyTest (allTables(dataset))
lapplyTest (allTables(dataset), fisher.test, simulate.p.value=TRUE)
# }

Run the code above in your browser using DataLab