The activity table is used to identify batches with too much noise.
Depending on the value of return these are filtered out, returned, or
identified in the alltags view with the column probability. No changes
to the database are made.
Usage
filterByActivity(
src,
return = "good",
view = "alltags",
minLen = 3,
maxLen = 5,
maxRuns = 100,
ratio = 0.85
)Arguments
- src
SQLite connection. Result of
tagme(XXX)orDBI::dbConnect(RSQLite::SQLite(), "XXX.motus").- return
Character. One of "good" (return only 'good' runs), "bad" (return only 'bad' runs), "all" (return all runs, but with a new
probabilitycolumn which identifies 'bad' (0) and 'good' (1) runs.- view
Character. Which view to use, one of "alltags" (faster) or "alltagsGPS" (with GPS data).
- minLen
Numeric. The minimum run length to allow (equal to or below this, all runs are 'bad')
- maxLen
Numeric. The maximum run length to allow (equal to or above this, all runs are 'good')
- maxRuns
Numeric. The cutoff of number of runs in a batch (see Details)
- ratio
Numeric. The ratio cutoff of runs length 2 to number of runs in a batch (see Details)
Details
Runs are identified by the following:
All runs with a length >=
maxLenare GOODAll runs with a length <=
minLenare BADRuns with a length between
minLenandmaxLenare BAD IF both of the following is true:belong to a batch where the number of runs is >=
maxRunsthe ratio of runs with a length of 2 to the number of runs total is >=
ratio
Examples
# Download sample project 176 to .motus database (username/password are "motus.sample")
if (FALSE) sql_motus <- tagme(176, new = TRUE)
# Or use example data base in memory
sql_motus <- tagmeSample()
tbl_good <- filterByActivity(sql_motus)
tbl_bad <- filterByActivity(sql_motus, return = "bad")
tbl_all <- filterByActivity(sql_motus, return = "all")
