Created
December 22, 2021 15:20
-
-
Save jhnwllr/598afb4b49db1ab3e26500487f010d29 to your computer and use it in GitHub Desktop.
make an html table for pasting into outlook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dplyr) | |
library(purrr) | |
library(xtable) | |
d = readr::read_tsv("C:/Users/ftw712/Desktop/Legume/data/legume_unmatched.tsv") %>% | |
arrange(-count) %>% | |
glimpse() %>% | |
head(30) %>% | |
mutate(n_suggestions = map_int(v_scientificname,~nrow(rgbif::name_suggest(.x)$data))) %>% | |
mutate(n_suggestions = format(n_suggestions, nsmall = 0)) %>% | |
mutate(n_occ = format(count, nsmall = 0)) %>% | |
mutate(link = paste0('<a href=https://www.gbif.org/species/search?q=',gsub(" ","%20",v_scientificname),'>search</a>')) %>% | |
select(v_scientificname,n_occ,n_suggestions,link) %>% | |
glimpse() | |
print(xtable(d), type = "html", file = "C:/Users/ftw712/Desktop/html_table.html",sanitize.text.function = force,include.rownames=FALSE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment