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

Description Usage Arguments Examples

View source: R/data.check.r

Description

Check the data file and provide fixes if available

Usage

1
2
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

 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
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 Oct. 10, 2019, 4:53 a.m.