string_to_map: Converts a comma-separated string to a CHOIR BM

Description Usage Arguments Value Examples

View source: R/string_to_map.R

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

1
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

1
2
3
4
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")

CHOIRBM documentation built on Feb. 15, 2021, 5:07 p.m.