Skip to content

Commit

Permalink
updating index to have headers and better documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Deckart2 committed Feb 23, 2023
1 parent ee12f19 commit 3f3240e
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 2,538 deletions.
5 changes: 1 addition & 4 deletions R/create_tb.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@ create_tb <- function(metrics_info_df,
relocate(!!sym(quality_var), .after = last_col())

}
#
#
# print("temp is:")
# print(temp)


temp %>%
pivot_longer(!state_county, names_to="metrics", values_to="value") %>%
Expand Down
12 changes: 4 additions & 8 deletions R/create_tb_level2.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ create_tb_level2 <- function(metrics_info_df,
mb_vars_lst <- colnames(dataset %>%
select(setdiff(matches(mb_vars),
matches("_lb|_ub|_quality"))))
#print(c("mb_vars_lst is: ", mb_vars_lst))


if (ci_vars == 1){

for (val in mb_vars_lst){ # update this to purrr
Expand Down Expand Up @@ -110,14 +109,14 @@ create_tb_level2 <- function(metrics_info_df,

col_from <- col_from[-grep("*_ci", col_from)]
col_to <- col_to[-grep("*_ci", col_to)]
notes <- paste0(notes,

notes <- paste0(notes,
"<br><br>",
"The Confidence Interval for this metric is not applicable.")

}

temp %>%
temp <- temp %>%
mutate_all(as.character) %>%
rename_at(vars(col_from), function(x) col_to)

Expand All @@ -129,9 +128,6 @@ create_tb_level2 <- function(metrics_info_df,

}

# print("temp is:")
# print(temp)

temp %>%
pivot_longer(!state_county, names_to="metrics", values_to="value") %>%
pivot_wider(names_from = "state_county", values_from = "value") %>%
Expand Down
6 changes: 1 addition & 5 deletions R/create_tb_level2_no_tabs.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ create_tb_level2_no_tabs <- function(metrics_info_df,
mb_vars_lst <- colnames(dataset %>%
select(setdiff(matches(mb_vars),
matches("_lb|_ub|_quality"))))
#print(c("mb_vars_lst is: ", mb_vars_lst))


if (ci_vars == 1){

for (val in mb_vars_lst){ # update this to purrr
Expand Down Expand Up @@ -128,9 +127,6 @@ create_tb_level2_no_tabs <- function(metrics_info_df,
relocate(!!sym(quality_var), .after = last_col())

}
#
# print("temp is:")
# print(temp)

temp %>%
pivot_longer(!state_county, names_to="metrics", values_to="value") %>%
Expand Down
4 changes: 0 additions & 4 deletions R/create_tb_level3.R
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,6 @@ create_tb_level3 <- function(metrics_info_df,
table2 = create_tb_by_subgroup(sg_lst[2], note = notes3)
)

# for (i in sg_lst){
# print(create_tb_by_subgroup(i))
# }

} else{

create_tb_by_subgroup(subgroup_this_var, note = notes2)
Expand Down
2 changes: 1 addition & 1 deletion R/render_pages.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#'
#' @returns pwalk implicitly returns the list inputted to it. The return objects
#' are not used for this function, however.
render_pages <- function(prepped_object, input = "index.Rmd") {
render_pages <- function(prepped_object, input = "index.qmd") {

prepped_object %>%
select(output_file = filename,
Expand Down
21 changes: 21 additions & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
project:
type: website
output-dir: '.'


website:
navbar:
background: primary
left:
- text: "Home"
file: index.qmd
- text: "Description"
file: description.qmd

output:
html_document:
output_dir: '.'
css: styles.css
lib_dir: site_libs
self_contained: no
output_dir: '.'
File renamed without changes.
609 changes: 0 additions & 609 deletions description.Rmd

This file was deleted.

2 changes: 1 addition & 1 deletion description.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ This metric is the ratio of the number of employed adults ages 25 to 54 in a giv

<br>

##### PREDICTOR: ACCESS TO JOBS PAYING A LIVING WAGE {sec-job-living-wage}
##### PREDICTOR: ACCESS TO JOBS PAYING A LIVING WAGE {#sec-job-living-wage}

**Metric: Ratio of pay on the average job to the cost of living**

Expand Down
Loading

0 comments on commit 3f3240e

Please sign in to comment.