py_read_gt3x: Read GT3X File

Description Usage Arguments Value Examples

View source: R/py_read_gt3x.R

Description

Read GT3X File

Usage

1
py_read_gt3x(path, create_time = FALSE, verbose = FALSE)

Arguments

path

file to GT3X file

create_time

Should time stamps be created?

verbose

print diagnostic messages

Value

A list of meta data, accelerometry data, and time stamps

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
reticulate::py_config()

path = system.file("extdata", "TAS1H30182785_2019-09-17.gt3x",
package = "pygt3x")
if (pygt3x:::have_python_requirements()) {
res = py_read_gt3x(path)
}

## Not run: 
if (pygt3x:::have_python_requirements()) {
  out = impute_zeros(res$data, res$dates, res$header)
  out = impute_zeros(res)

  url = "https://github.com/THLfi/read.gt3x/files/3522749/GT3X%2B.01.day.gt3x.zip"
  destfile = tempfile(fileext = ".zip")
  dl = download.file(url, destfile = destfile, mode = "wb")
  gt3x_file = unzip(destfile, exdir = tempdir())
  gt3x_file = gt3x_file[!grepl("__MACOSX", gt3x_file)]
  path = gt3x_file

  res = py_read_gt3x(path)
  df = impute_zeros(res$data, res$dates, res$header)
}

## End(Not run)

oslerinhealth/pygt3x documentation built on Nov. 20, 2020, 11:46 p.m.