cleandata: Clean CGM Data

Description Usage Arguments Details Examples

View source: R/cleandata.R

Description

This function returns cleaned CGM files for analysis. Files must not be edited, and should be saved in the original format. If any files need to be edited manually, please save them in the format specified by the cgmvariables() function. If this function is unable to read your unedited CGM data, it may help to save your data in the format above.

Usage

1
2
3
4
5
6
7
cleandata(inputdirectory,
outputdirectory = tempdir(),
removegaps = TRUE,
gapfill = TRUE,
maximumgap = 20,
id_filename = F,
verbose = F)

Arguments

inputdirectory

The directory containing CSV files for cleaning prior to analysis.

outputdirectory

The directory where cleaned CSV files will be written.

removegaps

Determines whether the data are cleaned or not. If set to TRUE, any gaps in the data will be removed along with the 24 hours of data containing the gap(s). The tail end of the data will also be trimmed to ensure the timeseries is in discrete 24 hour chunks.

gapfill

If set to TRUE (and if removegaps = TRUE), gaps smaller than or equal to maximumgap will be interpolated rather than removed.

maximumgap

Allows the user to determine the longest data gap (in minutes) that will be interpolated.

id_filename

If true, the file name will be used for subject ID rather than the ID contained in the data.

verbose

If true, each file name will print as the program runs for troubleshooting purposes.

Details

Because Diasend data is exported in an Excel document containing multiple tabs, the CGM data must be in the first tab in order to be read effectively.

Examples

1
2
3
## Not run: cleandata(system.file("extdata", "De-identified",
package = "cgmanalysis"))
## End(Not run)

cgmanalysis documentation built on June 9, 2021, 9:06 a.m.