Title: Plots the CHOIR Body Map
Version: 0.0.2
Description: Collection of utility functions for visualizing body map data collected with the Collaborative Health Outcomes Information Registry.
License: MIT + file LICENSE
URL: https://github.com/emcramer/CHOIRBM
BugReports: https://github.com/emcramer/CHOIRBM/issues
Depends: R (≥ 3.5.0)
Imports: ggplot2, rlang, stringr
Suggests: knitr, rmarkdown, testthat (≥ 2.0.0)
VignetteBuilder: knitr
Config/testthat/edition: 2
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.1
NeedsCompilation: no
Packaged: 2021-02-11 22:15:35 UTC; crame
Author: Eric Cramer ORCID iD [aut, cre], Stanford University School of Medicine [cph, fnd]
Maintainer: Eric Cramer <emcramer@stanford.edu>
Repository: CRAN
Date/Publication: 2021-02-15 16:50:11 UTC

CHOIRBM: Plots the CHOIR Body Map

Description

Collection of utility functions for visualizing body map data collected with the Collaborative Health Outcomes Information Registry.

Author(s)

Maintainer: Eric Cramer emcramer@stanford.edu (ORCID)

Other contributors:

See Also

Useful links:


Generate Simple Example Data

Description

Creates a data frame with CHOIR Body Map segment IDs and a randomly associated value. Also adds grouping information for facetting while plotting.

Usage

gen_example_data(seed = 123)

Arguments

seed

integer to seed the random number generator

Value

values data.frame

Examples

cbm_df <- gen_example_data()
head(cbm_df)


Plot the male CHOIR Body Map

Description

Creates a new plot of the front and back of the female CHOIR body map.

Usage

plot_female_choirbm(df, value)

Arguments

df

data.frame

value

string

Value

ggrob

Examples

cbm_df <- gen_example_data()
plot_female_choirbm(cbm_df, "value")


Plot the male CHOIR Body Map

Description

Creates a new plot of the male CHOIR body map.

Usage

plot_male_choirbm(df, value)

Arguments

df

data.frame

value

string

Value

ggrob

Examples

cbm_df <- gen_example_data()
plot_male_choirbm(cbm_df, "value")


Converts a comma-separated string to a CHOIR BM

Description

Takes a string of IDs that are separated by a comma and converts the information into a data frame with a binary indication of whether or not an ID appeared. Useful for plotting an individual's CHOIR BM or for isolating particular sections to highlight.

Usage

string_to_map(map_str = "", delim = ",")

Arguments

map_str

The delimited CBM string.

delim

The delimiter for the CBM string.

Value

ret_df data.frame with all of the CHOIR BM segment IDs with a 1 if the segment was present and 0 otherwise.

Examples

cbm_str <- "101,102,103,104,201,202"
cbm_df <- string_to_map(cbm_str)
#plot in a male or female bodymap...
plot_male_choirbm(cbm_df, "value")


CHOIR Body Map data for approximately 7,000 patients

Description

A non-identifiable, simulated data set generated by randomly permuting data from the CHOIR Body Map validation study.

Usage

data(validation)

Format

An object of class "data.frame"

id

A randomly generated numeric code for each patient.

gender

The patient's gender.

race

The patient's race.

age

The patient's age.

bodymap_regions_csv

The patient's CHOIR Body Map in a comma separated string.

score

A simulated pain score for demonstration purposes.

References

This data set was derived from the data collected during the study validating the CHOIR Body Map as an instrument for recording a patient's anatomical pain location. doi: 10.1097/pr9.0000000000000880

Examples


data(validation)
head(validation)