hgraphr: hgraphr

View source: R/hgraphr.R

hgraphrR Documentation

hgraphr

Description

A plot for showing high dimensional attributes with indication of percentile ranges.

Usage

hgraphr(
  df,
  index,
  color_palette = c("#feedde", "#fdd0a2", "#fdae6b", "#fd8d3c", "#f16913")
)

Arguments

df

data frame containing values to be plotted. Data frame must contain: dimension, measure, individual, and neighborhood. Dimension is a factor, measure is numeric, and individual and neighborhood are logical.

index

numeric value representing the individual's relative risk index based on the population.

color_palette

vector of RGB background colors to be used for percentile ranges (0, 50), (50, 80), (80, 90), (90, 95), (95, 100)

Examples

df = data.frame(
dimension = factor(state.name[1:22]),
measure = runif(22) * 100,
individual = sample(c(TRUE, FALSE, FALSE), 22, replace = TRUE),
neighborhood = sample(c(TRUE, TRUE, FALSE), 22, replace = TRUE)
) %>%
  dplyr::mutate(measure = ifelse(individual == FALSE &
                                   neighborhood == FALSE, NA, measure))
hgraphr(df, index = 67)

johnaclouse/eggplots documentation built on April 8, 2022, 11:29 a.m.