From 2593a36c28f18fa79b1be01b8a7b7a556f8915d9 Mon Sep 17 00:00:00 2001 From: andybeet <22455149+andybeet@users.noreply.github.com> Date: Tue, 7 Jan 2025 13:07:46 -0500 Subject: [PATCH] replaced kableExtra with gt --- .github/workflows/stocksmartapi.yml | 2 +- data-raw/sendAsEmail.Rmd | 44 ++++++++++++++++++----------- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/.github/workflows/stocksmartapi.yml b/.github/workflows/stocksmartapi.yml index ad034b3..7851972 100644 --- a/.github/workflows/stocksmartapi.yml +++ b/.github/workflows/stocksmartapi.yml @@ -50,7 +50,7 @@ jobs: - name: Install packages run: | - install.packages(c("remotes","dplyr", "httr", "here","readxl", "usethis","kableExtra","rmarkdown","rlang")) + install.packages(c("remotes","dplyr", "httr", "here","readxl", "usethis","gt","rmarkdown","rlang")) remotes::install_github("NOAA-EDAB/stocksmart") shell: Rscript {0} diff --git a/data-raw/sendAsEmail.Rmd b/data-raw/sendAsEmail.Rmd index 1a36622..fc0c215 100644 --- a/data-raw/sendAsEmail.Rmd +++ b/data-raw/sendAsEmail.Rmd @@ -31,29 +31,35 @@ writeLines(a) ### Species Added ```{r, echo = F} if(nrow(params$sumrowAdd)>0) { - params$sumrowAdd %>% - dplyr::mutate(`ITIS Taxon Serial Number` = paste0("(",`ITIS Taxon Serial Number`,"):")) %>% - kableExtra::kable() + params$sumrowAdd |> + dplyr::mutate(`ITIS Taxon Serial Number` = paste0("(",`ITIS Taxon Serial Number`,"):")) |> + gt::gt() } ``` ### Species Removed ```{r, echo = F} if(nrow(params$sumrowRem)>0){ -params$sumrowRem %>% - dplyr::mutate(`ITIS Taxon Serial Number` = paste0("(",`ITIS Taxon Serial Number`,"):")) %>% - kableExtra::kable(col.names =NULL) +params$sumrowRem |> + dplyr::mutate(`ITIS Taxon Serial Number` = paste0("(",`ITIS Taxon Serial Number`,"):")) |> + gt::gt() } ``` ### Columns added ```{r, echo = F} -kableExtra::kable(params$sumcolAdd,col.names =NULL) +if(nrow(params$sumcolAdd)>0) { + params$sumcolAdd |> + gt::gt() +} ``` ### Columns removed ```{r, echo = F} -kableExtra::kable(params$sumcolRem,col.names =NULL) +if(nrow(params$sumcolRem)>0) { + params$sumcolRem |> + gt::gt() +} ``` @@ -62,9 +68,9 @@ kableExtra::kable(params$sumcolRem,col.names =NULL) ### Species Added ```{r, echo = F} if(nrow(params$datrowAdd)>0){ - params$datrowAdd %>% - dplyr::mutate(ITIS = paste0("(",ITIS,"):")) %>% - kableExtra::kable() + params$datrowAdd |> + dplyr::mutate(ITIS = paste0("(",ITIS,"):")) |> + gt::gt() } ``` @@ -74,20 +80,26 @@ if(nrow(params$datrowAdd)>0){ ### Species Removed ```{r, echo = F} if(nrow(params$datrowRem)>0) { - params$datrowRem %>% - dplyr::mutate(ITIS = paste0("(",ITIS,"):")) %>% - kableExtra::kable(col.names =NULL) + params$datrowRem |> + dplyr::mutate(ITIS = paste0("(",ITIS,"):")) |> + gt::gt() } ``` ### Columns added ```{r, echo = F} -kableExtra::kable(params$datcolAdd,col.names =NULL) +if(nrow(params$datcolAdd)>0) { + params$datcolAdd |> + gt::gt() +} ``` ### Columns removed ```{r, echo = F} -kableExtra::kable(params$datcolRem,col.names =NULL) +if(nrow(params$datcolRem)>0) { + params$datcolRem |> + gt::gt() +} ```