Description Usage Arguments Details Value Examples
The goal of this function is to calculate the values of a test performed
by FUN
after each of sample_count
permutations.
1 | permutation_test(table1, table2, sample_size, sample_count, FUN, ...)
|
table1 |
The first table. |
table2 |
The second table. |
sample_size |
The number of element to draw for each table. |
sample_count |
The number of permutations. |
FUN |
The function to use to compare the 2 table. First two params
must be |
... |
Extra param for |
Each round of the permutation test, two new matrices will be randomly
sampled from using the combination of the two original tables. The means
of each columns will be calculated to produce the vectors that will be sent
FUN
.
A vector
of numeric corresponding to the result of each
permutation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
# Get some tables
mg <- get_demo_metagene()
mg$produce_table()
tab <- mg$get_table()
tab <- tab[which(tab$region == "list1"),]
tab1 <- tab[which(tab$design == "align1_rep1"),]
tab2 <- tab[which(tab$design == "align2_rep2"),]
# Perform permutation test
sample_size <- min(nrow(tab1), nrow(tab2))
FUN = function(a, b) { mean(a) - mean(b) } # Dummy function for demo purpose
# A sample_count >= 1000 should be used in a real analysis
permutation_results <- permutation_test(m1, m2, sample_size = sample_size,
sample_count = 10, FUN = FUN)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.