data.check: Check the data file and provide fixes if available

View source: R/data.check.r

data.checkR Documentation

Check the data file and provide fixes if available

Description

Check the data file and provide fixes if available

Usage

data.check(dataset, refreshRate = 85, time.unit = 1, check.only = F, ...)

Arguments

dataset

an object of the type data.frame

refreshRate

the refresh rate used during the motion capture (in hertz)

time.unit

the unit of measurement in which time is expressed in the 'time' column of the dataset given to the function. 1 = seconds, 10 = deciseconds, 100 = centiseconds, 1000 = milliseconds, ... Default to 1000

Examples

libraries()

### restoring missing columns

head(rtgData_bad) # dataset provided by this package
rtgChecked <- data.check(rtgData_bad) # subjName is given without quotes. When asked to type the subject name, run the next line as is
test_subject
head(rtgChecked)

### time.unit

rtgData <- data.check(rtgData) # dataset provided by this package
# time column in rtgData is in milliseconds. Note that data.check allows to specify different time units as well
head(rtgData)

# instead, should the dataset have time in seconds
# the function will return frameT as a vector of NAs
data(rtgData) # reload dataset
rtgData$time <- rtgData$time / 1000 # change time to seconds
rtgData <- data.check(rtgData)
rtgData$frameT # always check that frameT looks good

# use time.unit to fix it
data(rtgData) # reload dataset
rtgData$time <- rtgData$time / 1000 # change time to seconds
rtgData <- data.check(rtgData, time.unit = 1)
rtgData$frameT


ccamp83/kinesis documentation built on Feb. 28, 2024, 12:11 p.m.