Skip to content

Idea: An R package to parse the .c2d file format from Cyclus2 ergometers.

License

Notifications You must be signed in to change notification settings

dhprlab/c2dParseR

Repository files navigation

c2dParseR

Warning

🚧 This is work in progress, please tread with care. 🚧

An R package to work with the .c2d file format from Cyclus2 ergometers.

badge-experimental

The goal of c2dParseR is to provide tools for working with .c2d files generated by Cyclus2 cycling ergometers by RBM elektronik-automation GmbH. Technically, .c2d files are “just” gzip-compressed XML text files with custom content, see vignette("about-c2d-format") for more information.

Motivation

Working with Cyclus2 data in their native .c2d file format has many advantages over derived, exported formats:

  • Access everything: Only .c2d files contain all data.
    • The .c2d files include all information, e.g., bike settings are impossible to export.
    • Depending on the export settings, exported files may lack data of (later) interest, or may lack numerical precision.
  • Simpler procedure: No need to save the same data twice, as export for analysis and as .c2d for archiving.
  • Interoperability: Even in a single lab, agreeing on an export format would take time and effort, and any change may make previously exported data incompatible. In contrast, .c2d files remain the same, even across labs, and thus analysis scripts remain compatible.

Installation

You can install the development version of c2dParseR from GitHub with:

# install.packages("pak")
pak::pak("dhprlab/c2dParseR")

Example

To import data from a .c2d (gzip-compressed XML) file:

library(c2dParseR)
# data <- c2dimport("path/to/your/example.c2d")

Roadmap

  • Implement basic import of all useful .c2d information into tidyverse tibbles.
  • Prepare for installation from GitLab/GitHub as initial distribution channels.
  • Add example data that can be used for documentation and testing.
  • Implement data validation and error handling.
  • Prepare for installation from CRAN.
  • Figure out if measurement units can be added to the output tibbles?
  • Figure out export into BIDS format; maybe using an existing package?
  • Write tests against the example data sets.

Example data

We plan to include example data files into this project. Any included data files must only serve a technical purpose, such as showcasing their content for documentation and testing the code. If possible, included data should NOT reflect human behavior or physiology.

This project aims to avoid the distribution of data that contain any personal identifying information as defined by the Eurpean Union’s General Data Protection Regulation (GDPR). Note that data about performance on an ergometer (like a Wingate test) or physiological markers (like heartrate) are inherently personal data, and often fall into the GDPR category of Health Data. Adding such data is at odds with our goal to distribute this package as widely as possible, for any purpose. See also licensing information.

Contributing

Any contribution is very welcome. The primary way to contribute is via GitHub, at https://github.com/dhprlab/c2dparseR. Please open an issue to report a bug or discuss a feature request.

This project follows the workflow recommendations from the book R Packages by Hadley Wickham and Jennifer Bryan. For a quick overview of the recommended workflow, see review in The Whole Game chapter.

Tidyverse compatibility

This package aims to be compatible with the tidyverse principles of data organization and manipulation, e.g., when combining data from multiple .c2d files. Specifically, to quote from the tidy data documentation,

“in Tidy data:

  • Each variable is a column; each column is a variable.
  • Each observation is a row; each row is an observation.
  • Each value is a cell; each cell is a single value.”

Authors

Licensing

This project is licensed under the European Union Public License (EUPL-1.2). See full license text in English at LICENSE.txt; for other languages, see https://interoperable-europe.ec.europa.eu/collection/eupl/eupl-text-eupl-12.

Note: Dual-licensing for code and example data was considered, but deemed impractical due to CRAN’s restriction to use a single license. We will thus not add data beyond examples for purely technical purposes, avoiding any personal data; see also section example data.

About

Idea: An R package to parse the .c2d file format from Cyclus2 ergometers.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages