Skip to content

Commit

Permalink
replaced kableExtra with gt
Browse files Browse the repository at this point in the history
  • Loading branch information
andybeet committed Jan 7, 2025
1 parent 422759d commit 2593a36
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/stocksmartapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
44 changes: 28 additions & 16 deletions data-raw/sendAsEmail.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
```


Expand All @@ -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()
}
```

Expand All @@ -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()
}
```


Expand Down

0 comments on commit 2593a36

Please sign in to comment.