Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions R/bibentries.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ bibentries <- c(
pages = "e3298",
year = "2017",
publisher = "PeerJ Inc."
),
huang2019multilevel = bibentry("article",
title = "Multilevel matrix-variate analysis and its application to accelerometry-measured physical activity in clinical populations",
author = "Huang, Lei and Bai, Jiawei and Ivanescu, Andrada and Harris, Tamara and Maurer, Mathew and Green, Philip and Zipunnikov, Vadim",
journal = "Journal of the American Statistical Association",
year = "2019",
publisher = "Taylor & Francis"
)
)
# nolint end
22 changes: 22 additions & 0 deletions R/chf.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#' Congestive heart failure accelerometry data
#'
#' @description
#' Activity data from a study of congestive heart failure.
#'
#' @source <https://www.dropbox.com/scl/fi/vnuldgqnkfa532hzoazjj/chfData.zip>
#' @references `r format_bib("huang2019multilevel")`
#' @format A tibble with 13,300 rows and 9 variables:
#' \describe{
#' \item{id}{Unique identifier for each participant in the study.}
#' \item{gender}{Participant's gender, recorded as male or female.}
#' \item{age}{Age of the participant, in years.}
#' \item{bmi}{Body Mass Index (BMI) of the participant.}
#' \item{event_week}{The week number relative to a critical event.}
#' \item{event_type}{Type of event recorded, such as hospitalization.}
#' \item{week}{Week number during the study, indicating the time frame of data collection.}
#' \item{day}{Day of the week (e.g. Monday, Tuesday) when the activity data was recorded.}
#' \item{activity}{Activity levels recorded by accelerometer (resolution is 1 minute, so 24 h/day * 60 min/h = 1440 min/day).}
#' }
#' @examples
#' chf
"chf"
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ A collection of datasets containing functional data

## Installation

You can install the development version of gmeans from [GitHub](https://github.com/) with:
You can install the development version of tidyfundata from [GitHub](https://github.com/) with:

```{r, eval = FALSE}
# install.packages("pak")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A collection of datasets containing functional data

## Installation

You can install the development version of gmeans from
You can install the development version of tidyfundata from
[GitHub](https://github.com/) with:

``` r
Expand Down
17 changes: 17 additions & 0 deletions data-raw/chf.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
library(dplyr)

# data source: https://www.dropbox.com/scl/fi/vnuldgqnkfa532hzoazjj/chfData.zip
covar <- readr::read_csv(here::here("data-raw", "covariate.csv"), )
activity <- readr::read_csv(here::here("data-raw", "activity.csv"))

chf <- covar |>
inner_join(activity, by = join_by(id)) |>
tidyfun::tf_gather(activity.1:activity.1440, key = activity) |>
mutate(day = ordered(day,
levels = c(
"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"
),
labels = c("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")
))

usethis::use_data(chf, overwrite = TRUE, compress = "xz")
Binary file added data/chf.rda
Binary file not shown.
38 changes: 38 additions & 0 deletions man/chf.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading