Description Usage Arguments Details Value See Also Examples
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.
1 | lapplyTest(x, fun = chisq.test, ...)
|
x |
[list] The list to which to apply |
fun |
[function] The function which to apply to |
... |
Additional arguments passed to |
When applying a function to a list, any iteration that results in an error, breaks the whole loop. This is not always the most convenient behaviour, in particular when the function is a statistical test and the error is to do with sparse data in one of the tables in the list. lapplyTest
is a wrapper around base::lapply
which only differs from the original in its treatment of errors. It saves the message associated with the error or warning, but then continues to the next iteration rather than quitting the loop altogether.
[list.lapplyTest] A list of outputs of fun
.
summary.list.lapplyTest
, allCooccs
1 2 3 | dataset <- loadSampleDataset ("data-abc")
lapplyTest (allCooccs(dataset))
lapplyTest (allCooccs(dataset), fisher.test, simulate.p.value=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.