Skip to content

Commit

Permalink
comma and right align
Browse files Browse the repository at this point in the history
ref #3
  • Loading branch information
wibeasley committed Sep 1, 2018
1 parent e56bfdf commit 72293cf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions R/table-nih-enrollment.R
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ table_nih_enrollment_pretty <- function(d, d_lu_gender=NULL, d_lu_race=NULL, d_l

table_nih_enrollment(d, d_lu_gender, d_lu_race, d_lu_ethnicity) %>%
dplyr::mutate(
gender_ethnicity = paste0(.data$gender, " by ", .data$ethnicity)
# n = scales::comma(n),
n = n + 1000,
gender_ethnicity = paste0(.data$gender, " by ", .data$ethnicity)
) %>%
dplyr::select(-.data$gender, -.data$ethnicity) %>%
tidyr::spread(key=.data$gender_ethnicity, value=.data$n) %>%
Expand All @@ -232,7 +234,9 @@ table_nih_enrollment_pretty <- function(d, d_lu_gender=NULL, d_lu_race=NULL, d_l
# `Unknown/ Not Reported` = `Unknown/Not Reported by Unknown/Not Reported Ethnicity`,
# ) %>%
knitr::kable(
format = "html",
format = "html",
# align = "lrrrrrrrrr",
format.args = list(big.mark=","),
col.names = c(
"Racial\nCategories",
"Female",
Expand All @@ -250,6 +254,7 @@ table_nih_enrollment_pretty <- function(d, d_lu_gender=NULL, d_lu_race=NULL, d_l
bootstrap_options = c("striped", "hover", "condensed", "responsive"),
full_width = FALSE
) %>%
kableExtra::column_spec(c(1, 4, 7), border_right = T) %>%
kableExtra::add_header_above(c(
" " = 1L,
"Not Hispanic or Latino" = 3L,
Expand Down

0 comments on commit 72293cf

Please sign in to comment.