segmentRefine_pcurve: Segment within a JSONLabel with a principal curve

Description Usage Arguments Details See Also Examples

Description

Takes a segmented "FemFit" object and constructs new baseline and event labels within the specified JSONLabel.

Usage

1
2
segmentRefine_pcurve(x, whichSession, whichJSONLabel, windowSize = 5,
  windowTolerance = 1, timeScale = 1000, ...)

Arguments

x

An "FemFit" object.

whichSession

A character string which identifies which session to edit.

whichJSONLabel

A character string which identifies which JSONLabel to edit.

windowSize

Define event duration. Defaults to 5 seconds with timeScale = 1000.

windowTolerance

Define the tolerance for defining an event. A numeric vector of length two can be provided. Defaults to +/- 1 second with timeScale = 1000.

timeScale

Time scale to work on. Defaults to working in seconds.

...

Arguments passed to principal.curve.

Details

Conducts principal component analysis then fits a principal curve to the first principal component and time. Regions are identified temporally with the principal curve. Regions are classified as events if the region sits above the principal curve and meets the windowSize specifications.

If a vector is inputted for either whichSession or whichJSONLabel, only the first element is used.

See Also

prcomp and principal.curve for how the main statistical learning components work.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Read in the FemFit data
AS005 = read_FemFit(c(
        "Datasets_AukRepeat/61aa0782289af385_283_csv.zip",
        "Datasets_AukRepeat/61aa0782289af385_284_csv.zip"
    ),
    remove.NAs = TRUE
  ) %>%
  # Segment the FemFit data
  segment(
    cp. = 0.001,
    numOfNodesToLabel = list(c(3, 1, 3, 4), c(4, 1, 5, 3))
  )

# Within a session refine the segmentation with principal curves
AS005r = segmentRefine_pcurve(
    x = AS005,
    whichSession = "283 09:28",
    whichJSONLabel = "pfmc3x5s_rest30s",
    windowTolerance = c(1, 1)
  )

TheGreatGospel/IVPSA documentation built on May 19, 2019, 1:47 a.m.