read_FemFit: Reading an FemFit dataset

Description Usage Arguments Details Value See Also Examples

View source: R/read_FemFit.r

Description

Reads in a compressed file found at https://pfmeasure.com and returns it as an "FemFit" object.

Usage

1
2
read_FemFit(zipPath, remove.NAs = FALSE, remove.spikes = FALSE,
  spikes.threshold = 2, merge.csvs = FALSE)

Arguments

zipPath

The filepath of compressed file.

remove.NAs

If set to TRUE, remove unlabelled observations. Defaults to FALSE.

remove.spikes

If set to TRUE, remove observations conditional on spikes.threshold. Defaults to FALSE.

spikes.threshold

The numeric threshold to remove pressure fluctuations associated with the change in temperature.

merge.csvs

If set to TRUE, merges comma-separated files. Defaults to FALSE.

Details

zipPath can take a vector of filepaths and if it is, the remaining arguments are recycled to the length of zipPath.

remove.NAs removes observations that were not labelled with any protocol information found in the "session" JavaScript Object Notation file.

remove.spikes removes observations where the sum of the lagged temperature differences across the eight sensors is greater than or equal to spikes.threshold.

merge.csvs merges all of the valid comma separated value file(s). The resulting session identifier is determined by alphabetical order.

A valid comma separated file is determined with the device timestamps found in the "session" JavaScript Object Notation file.

Value

The "FemFit" object contains an element called df which contains the data found in the compressed file. It also contains one NULL element errorSummary, which is updated by segment.

The data contains 19 columns, time, pressure recordings for sensors 1 to 8, temperature recordings for sensors 1 to 8, patient identifier, session identifier, and the assigned protocol labels for the session.

See Also

FemFit_removeNAs FemFit_removeSpikes FemFit_mergeCSVs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Basic example
session283 = read_FemFit("Datasets_AukRepeat/61aa0782289af385_283_csv.zip", remove.NAs = TRUE)

# Specify that the second session should have it's NAs removed
AS027 = read_FemFit(c(
        "Datasets_AukRepeat/dee8fc3fdcfccb27_744_csv.zip",
        "Datasets_AukRepeat/dee8fc3fdcfccb27_746_csv.zip"
    ),
    remove.NAs = c(
        FALSE,
        TRUE
    ))

# Specify that the sessions should remove pressure fluctuations associated with the change in temperature
AS011 = read_FemFit(c(
        "Datasets_AukRepeat/dee8fc3fdcfccb27_642_csv.zip",
        "Datasets_AukRepeat/dee8fc3fdcfccb27_643_csv.zip"
    ),
    spikes.threshold = 2,
    remove.spikes = c(
        FALSE,
        TRUE
    ))

# Specify that the CSVs found in the second compressed file should be merged together
AS013 = read_FemFit(c(
        "Datasets_AukRepeat/dee8fc3fdcfccb27_640_csv.zip",
        "Datasets_AukRepeat/dee8fc3fdcfccb27_641_csv.zip"
    ),
    merge.csvs = c(
        FALSE,
        TRUE
    ))

# An example of using more than one argument
AS008 = read_FemFit(c(
        "Datasets_AukRepeat/61aa0782289af385_417_csv.zip",
        "Datasets_AukRepeat/61aa0782289af385_418_csv.zip"
    ),
    remove.NAs = TRUE,
    remove.spikes = c(
        TRUE,
        FALSE
    ))

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