SwatPhonLab / ultrapolaRplot

GNU General Public License v3.0
1 stars 0 forks source link

more robust plotting functions #1

Open jonorthwash opened 2 months ago

jonorthwash commented 2 months ago

Assuming for now that filtering of categories is still happening in loadTraces():

  1. plot all categories in tier 'cons' as separate lines:

    rawTraces <- loadTraces("../palatals/", 'cons')
    # or
    rawTraces <- loadTraces("../palatals/", tiername='cons')
  2. plot all 'ɫ' and 'n' from any teir:

    rawTraces <- loadTraces("../palatals/", "", c('ɫ', 'n'))
    # or
    rawTraces <- loadTraces("../palatals/", tiername="", categories=c('ɫ', 'n'))
  3. plot just ɫ and n categories in tier 'cons':

    rawTraces <- loadTraces("../palatals/", 'cons', c('ɫ', 'n'))
    # pr
    rawTraces <- loadTraces("../palatals/", tiername='cons', categories=c('ɫ', 'n'))
    • specifying tiername as a list, e.g. tiername=c('cons'), is okay too
    • specifying categories as a list of a list, e.g. categories=list(c('ɫ', 'n')), is okay too
  4. plot all categories in tier 'cons' as single line:

    rawTraces <- loadTraces("../palatals/", 'cons', "")
    # or
    rawTraces <- loadTraces("../palatals/", tiername='cons', mergecategories=TRUE)
  5. plot just ɫ and n categories from tier 'cons' (explicit specification of tier for both categories):

# rawTraces <- loadTraces("../palatals/", c('cons', 'cons'), c('ɫ', 'n'))
# →
rawTraces <- loadTraces("../palatals/", 'cons', c('ɫ', 'n'))
# or
rawTraces <- loadTraces("../palatals/", tiername='cons', categories=c('ɫ', 'n'))
  1. plot ɫ and n in tier 'cons' together as one line and lʲ and nʲ in teir 'cons' together as another line
rawTraces <- loadTraces("../palatals/", 'cons', list(c('ɫ', 'n'), c('lʲ', 'nʲ')), mergecategories=TRUE)
# or
rawTraces <- loadTraces("../palatals/", tiername='cons', categories=list(c('ɫ', 'n'), c('lʲ', 'nʲ')), mergecategories=c(TRUE, TRUE))
  1. plot ɫ (from 'cons' tier, 'tongue' layer) and n (same) and palate (layer, regardless of tier or label) traces as separate lines:
# rawTraces <- loadTraces("../palatals/", c('cons', 'cons' ''), c('ɫ', 'n', ''), layer=c('tongue', 'tongue', 'palate'))
# or
# rawTraces <- loadTraces("../palatals/", tiername=c('cons', 'cons' ''), categories=c('ɫ', 'n', ''), layer=c('tongue', 'tongue', 'palate'))
# →
rawTraces <- loadTraces("../palatals/", tiername=c('cons', ''), categories=list(c('ɫ', 'n'), ''), layer=c('tongue', 'palate'))

for all of these

jonorthwash commented 1 month ago