| testSP | R Documentation | 
testSP performs an SP test
testSP(
  switches,
  permuteAll = FALSE,
  from = NULL,
  to = NULL,
  dropzeroes = TRUE,
  bylineage = FALSE,
  pseudocount = 0,
  alternative = c("greater", "two.sided", "less"),
  tip_switch = 20,
  exclude = FALSE
)
| switches | Data frame from findSwitches | 
| permuteAll | Permute among trees? | 
| from | Include only switches from this state? | 
| to | Include only switches to this state? | 
| dropzeroes | Drop switches with zero counts? | 
| bylineage | Perform test for each lineage individually? | 
| pseudocount | Pseudocount for P value calculations | 
| alternative | Perform one-sided ( | 
| tip_switch | maximum tip/switch ratio | 
| exclude | exclude clones with tip/switch ratio >  | 
Output data table columns: RECON = SP for observed data PERMUTE = SP for permuted data DELTA = RECON - PERMUTE PLT = p value for DELTA < 0 PGT = p value for DELTA < 0
FROM: State going from.
TO: State going to.
RECON: SP for observed data.
PERMUTE: SP for permuted data.
DELTA:  RECON - PERMUTE.
PLT: p value that DELTA < 0
PGT: p value that DELTA > 0
STAT: Statistic used (SP).
REP: Bootstrap repetition.
REPS: Total number of ootstrap repetition.
A list containing a tibble with mean SP statistics, and another 
with SP statistics per repetition.
Uses output from findSwitches. Related to testPS and testSC.
## Not run: 
igphyml <- "~/apps/igphyml/src/igphyml"
data(ExampleAirr)
ExampleAirr$sample_id = sample(ExampleAirr$sample_id)
clones = formatClones(ExampleAirr, trait="sample_id")
btrees = findSwitches(clones[1:2], bootstraps=10, nproc=1,
   igphyml=igphyml, trait="sample_id")
testSP(btrees$switches)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.