Skip to content

Commit

Permalink
Try with PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace committed Jul 12, 2024
1 parent 42a195b commit e57ca70
Show file tree
Hide file tree
Showing 6 changed files with 1,071 additions and 559 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ raw_data/
inst/doc

/.quarto/
paper_*
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Suggests:
terra,
devtools,
snakecase,
tmap
tmap,
gtExtras
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Expand Down
Binary file modified man/figures/README-fig-time-1.pdf
Binary file not shown.
Binary file modified man/figures/README-fig-time-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,605 changes: 1,058 additions & 547 deletions paper.html

Large diffs are not rendered by default.

21 changes: 10 additions & 11 deletions paper.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ keywords:
- Near misses
date: last-modified
format:
html: default
# pdf: default
# html: default
pdf: default
# arxiv-pdf:
# keep-tex: true
linenumbers: true # Add (continuous) line numbers?
Expand All @@ -62,7 +62,6 @@ editor_options:
markdown:
wrap: sentence
execute:
cache: true
echo: false
warning: false
---
Expand Down Expand Up @@ -418,10 +417,10 @@ d_offence_classified |>
mutate(
`Percent of records`= round(`Percent of records`)
) |>
rename(`# records` = `Number of records`, `% records`=`Percent of records`) |>
rename(`Number` = `Number of records`, `Percent`=`Percent of records`) |>
gt() |>
gt_plt_bar_pct(column = `% records`, fill = "#252525", scaled = TRUE, labels=TRUE, width=120, height=30, font_size = "15px") |>
gt_plt_bar_pct(column = `Percent`, fill = "#252525", scaled = TRUE, labels=TRUE, width=120, height=30, font_size = "15px") |>
text_transform(
fn <- function(x){
code <- str_extract(x, "^[^\ ]+")
Expand Down Expand Up @@ -492,9 +491,9 @@ d_all |>
arrange(desc(n)) |>
rename_all(snakecase::to_title_case) |>
# Rename N to "Number of records"
rename(`# records` = N, `% records` = `Percent of Records`) |>
rename(`Number` = N, `Percent` = `Percent of Records`) |>
gt() |>
gt_plt_bar_pct(column = `% records`, fill = "#252525", scaled = TRUE, labels=TRUE, width=120, height=30, font_size = "15px") |>
gt_plt_bar_pct(column = `Percent`, fill = "#252525", scaled = TRUE, labels=TRUE, width=120, height=30, font_size = "15px") |>
cols_width(1 ~ px(400), 2 ~ px(80)) |>
tab_style(
style = cell_text(size=px(18)),
Expand Down Expand Up @@ -664,9 +663,9 @@ d_all |>
arrange(desc(n)) |>
rename_all(snakecase::to_title_case) |>
# Rename N to "Number of records"
rename(`# records` = N, `% records` = `Percent of Records`) |>
rename(`Number` = N, `Percent` = `Percent of Records`) |>
gt() |>
gt_plt_bar_pct(column = `% records`, fill = "#252525", scaled = TRUE, labels=TRUE, width=120, height=30, font_size = "15px") |>
gt_plt_bar_pct(column = `Percent`, fill = "#252525", scaled = TRUE, labels=TRUE, width=120, height=30, font_size = "15px") |>
cols_width(1 ~ px(400), 2 ~ px(80)) |>
tab_style(
style = cell_text(size=px(18)),
Expand Down Expand Up @@ -696,9 +695,9 @@ d_with_location |>
arrange(desc(n)) |>
head(10) |>
rename_all(snakecase::to_title_case) |>
rename(`# records` = N, `% records` = `Percent of Records`) |>
rename(`Number` = N, `Percent` = `Percent of Records`) |>
gt() |>
gt_plt_bar_pct(column = `% records`, fill = "#252525", scaled = TRUE, labels=TRUE, width=120, height=30, font_size = "15px") |>
gt_plt_bar_pct(column = `Percent`, fill = "#252525", scaled = TRUE, labels=TRUE, width=120, height=30, font_size = "15px") |>
cols_width(1 ~ px(400), 2 ~ px(80)) |>
tab_style(
style = cell_text(size=px(18)),
Expand Down

0 comments on commit e57ca70

Please sign in to comment.