Skip to contents

Installation

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

# install.packages("remotes")
remotes::install_github("deboonstra/activpalProcessing")
remotes::install_github("deboonstra/pregnancy247")

There is an added installation call to a package called activpalProcessing because this package is no longer available on CRAN. An archived copy of this package is used. So, activpalProcessing must be installed prior to installing pregnancy247.

Usage

This package has two unique selections of functions based on the different needs of the Pregnancy 24/7 study team.

Actiwatch data quality check

The first selection includes the

functions. The read_msleep() function imports the sleep or nap data exported from the Actiwatch to be screened for valid data by check_msleep(), and write_msleep() and write_all_msleep() export the screend data. Rules for valid data may be found in the vingettes. quality_check() is an interface to the above functions for ease of use. An example of the utility of this interface is presented below.

quality_check(subject = "1000-AB", trimester = 1)

Currently, to check the Actiwatch data appropriately, the working directory must be the main directory containing the data of each subject within subject-specific folders based on IDs. It is also assumed the names of the folders in subject-specific directories are

  • Visit 1,
  • Visit 2, and
  • Visit 3

Actiwatch, activPAL, and diary data processing

The second selection of functions includes the remaining functions not listed above to process the Actiwatch, activPAL, and diary data. The process_data() function provides the main interface to the other functions based on the needs of the Pregnancy 24/7 study. An example of the utility of this interface is presented below.

process_data(subject = "1000-AB", trimester = 1, sleep_source = "./sleep.csv")

Currently, to process these data appropriately, you need to have your working directory set the directory containing the

  • DATA_Iowa_activPAL,
  • DATA_Pitt_activPAL, and
  • DATA_WVU_activPAL

sub-directories of data with subject-specific directories within each sub-directory. Additionally, it also assumes that each visit during the study period is the concatenation of the subject ID and trimester. If you are viewing the package as a basis of code for your own research study, you will need to make changes to how the functions depend on your file system.