-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visualizations (Interactive) #22
Labels
Comments
Code
library(tictoc)
library(provider)
library(tidyverse)
library(highcharter)
tic()
rhc_abb <- providers(specialty_code = "00-17") |>
count(state,
sort = TRUE,
name = "count")
#> # A tibble: 45 × 2
#> state count
#> <chr> <int>
#> 1 KY 370
#> 2 TX 332
#> 3 MO 326
#> 4 TN 263
#> 5 IL 262
#> 6 CA 252
#> 7 MS 227
#> 8 MI 221
#> 9 LA 214
#> 10 IA 209
#> # ℹ 35 more rows
rhc_map <- hcmap(
map = "countries/us/us-all",
data = rhc_abb,
value = "count",
joinBy = c("hc-a2", "state"),
name = "Rural Health Clinics",
dataLabels = list(enabled = TRUE, format = "{point.name}"),
borderColor = "#FAFAFA",
borderWidth = 0.1,
tooltip = list(
valueSuffix = " RHCs")) |>
hc_title(
text = "Number of <b>Rural Health Clinics</b> <i>by State</i>",
margin = 20,
align = "left",
style = list(color = "#22A884", useHTML = TRUE)) |>
hc_add_theme(hc_theme_bloom())
toc()
#> 4.14 sec elapsed Created on 2023-10-18 with reprex v2.0.2 |
Code
library(highcharter)
library(tidyverse)
library(provider)
ex <- gen_data(2020:2030) |>
change(pay) |>
dplyr::mutate(group = NULL) |>
dplyr::distinct(year, .keep_all = TRUE)
ex |>
hchart("column",
hcaes(x = year,
y = pay_chg),
name = "Change") |>
hc_yAxis(gridLineWidth = 0,
labels = list(
style = list(
color = "#000000")),
title = list(text = "",
style = list(
color = "#000000"))) |>
hc_xAxis(labels = list(
style = list(
color = "#000000")),
title = FALSE,
lineWidth = 0,
tickWidth = 0) |>
hc_title(text = "Yearly Absolute Change") |>
hc_tooltip(useHTML = TRUE,
crosshairs = TRUE,
borderWidth = 1,
sort = TRUE) |>
hc_plotOptions(column = list(
color = "red",
dataLabels = list(
enabled = TRUE))) |>
hc_add_theme(hc_theme_smpl()) |>
hc_size(height = 500, width = 550) Created on 2023-10-20 with reprex v2.0.2 |
andrewallenbruce
removed
the
presentation 📊
visualization or presentation related
label
Oct 31, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code
Created on 2023-10-18 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: