pprint: Selects and returns a descriptive value from the LM statistic...

Description Usage Arguments Details Value Examples

View source: R/lm_output.R

Description

Selects and returns a descriptive value from the LM statistic table

Usage

1
pprint(statt, sel = NA, table = 1, pretty = 1, ...)

Arguments

statt

statistic table of LM statistics generated by StartPLMScoRe

sel

list of selection criteria (see details)

table

returns results as a table with (default), table=0 returns only the values

pretty

rounds numeric output to two decimal points (default)

...

further arguments (currently not implemented)

Details

The function StartPLMScoRe() generates a large table with LM statistics, currently 318 different statistics. pprint can be used to select and return selected values from this table. The input stats refers to the LM statistic table. If you have run the command outputXY<-StartPLMScoRe() this table can be found with outputXY$Stats or outputXY[[3]]. With the input sel you specify your selection criteria, for example sel= c("PLMnr", "no./hour", "TST") will return the PLMnr index for total sleep time. The selection operates on three data types:

LM type
Main category LM:

CLM, nonCLM, PLM

Modifier 1:

l (left), r (right), b (bilateral), m (monolateral). These modifiers are added before the main category with and underscore separating the two, eg. r_CLM, b_nonCLM

Modifier 2:

r (respiratory event associated), nr (non respiratory event associated), a (arousal associated). These modifies are added after the main category, if there are more than two these are separated by and underscore, eg. PLMnr, PLMa, but CLMnr_a.

Other categories:

IMI, IMInr, Arousal, R events, Sleep/wake

Statistic
for LM:

number, no./hour, duration; mean, duration; SD, duration; min, duration; max

for IMI:

log; mean, log;SD, <10s; number, >90s; number, 10-90s; number

for Sleep/wake:

duration

for Arousal:

number, no./hour

for R events:

number, no./hour, % with CLM

Sleep/wake stage

TIB, TST, N1, N2, N3, REM, NREM

Include in the sel=c() input all items you want to retrieve from the LM statistic table. If you do not specify anything for any of the three categories (LM type, Statistic, Sleep/wake) all instances will be selected:

sel=c("PLMnr", "no./hour") will return PLMnr indices for TIB, TST, Wake, N1, N2, N3, REM, NREM

sel=c("IMI") will return all available statistics for all sleep/wake stages

You can also specify multiple selections from a single category:

sel=c("CLM", "CLMnr", "number", "N1", "REM") will return the number of CLM and CLMnr during N1 and REM sleep.

Value

the selected descriptive statistics

Examples

1
2
3
4
5
6
7
8
# Return PLMS index from LM statistics table \emphasis{lmstat}
## Not run: pprint(lmstat, sel=c("PLM", "no./hour", "TST"))

# Return PLMS index from LM statistics table \emphasis{lmstat} but do not round the result
## Not run: pprint(lmstat, sel=c("PLM", "no./hour", "TST"), pretty=0)

#Return PLMS and PLMSnr index
## Not run: pprint(lmstat, sel=c("PLM", "PLMnr", "no./hour", "TST"))

Steph-Fulda/PLMScoRe documentation built on June 24, 2020, 4:09 p.m.