Skip to content

Instantly share code, notes, and snippets.

View maelle's full-sized avatar

Maëlle Salmon maelle

View GitHub Profile
@maelle
maelle / results.md
Created March 21, 2024 14:55
EMODnetWFS proj
library("EMODnetWFS")
service <- "chemistry_marine_litter"
layers_info <- emodnet_get_wfs_info(service = service)
#> Loading ISO 19139 XML schemas...
#> Loading ISO 19115 codelists...
#> ✔ WFS client created successfully
#> ℹ Service: "https://www.ifremer.fr/services/wfs/emodnet_chemistry2"
#> ℹ Version: "2.0.0"
layer <- layers_info[layers_info[["format"]] == "sf",][2,][["layer_name"]]
@maelle
maelle / results.md
Created March 15, 2024 10:15
EMODnetWFS
library(EMODnetWFS)
withr::local_options("EMODnetWFS.quiet" = TRUE)
services <- emodnet_wfs()[["service_name"]]

print_crs <- function(service) {
    cli::cli_rule()
    cli::cli_alert_info(service)
    # choose the first layer, 
    # presumedly all layers would use the same configuration/projection?
@maelle
maelle / script.R
Last active July 20, 2023 14:55
glitter + UniProt
# pak::pak("lvaudor/glitter")
library("glitter")
# Select all taxa from the UniProt taxonomy
# doesn't work yet https://github.com/lvaudor/glitter/issues/144
# Select all bacterial taxa and their scientific name from the UniProt taxonomy
# rdfs is a common prefix so built-in
spq_init() %>%
spq_prefix(prefixes = c(
@maelle
maelle / stuff.md
Created October 18, 2022 08:17
gist gist gist

Stuff and things

head of mtcars

head(mtcars)
@maelle
maelle / stuff.md
Created October 18, 2022 08:12
gist gist gist

Stuff and things

head of mtcars

head(mtcars)
@maelle
maelle / stuff.md
Created October 18, 2022 08:06
gist gist gist

Stuff and things

head of mtcars

head(mtcars)
@maelle
maelle / glitter-redirect.R
Created February 16, 2022 13:04
glitter-redirect
pkgdown_site_folder <- "glitter"
glitter_redirect <- function() {
'<html>
<head>
<meta http-equiv="refresh" content="0;URL=https://lvaudor.github.io/glitter/" />
<script language="javascript">
window.location.href = "https://lvaudor.github.io/glitter/"
</script>
</head>
<html>
<head>
<meta http-equiv="refresh" content="0;URL=https://lvaudor.github.io/glitter/" />
<script language="javascript">
window.location.href = "https://lvaudor.github.io/glitter/"
</script>
</head>
</html>
@maelle
maelle / punctuation.R
Created October 12, 2021 13:48
Extract special and operators from R code
path <- #path to pkg
scripts <- fs::dir_ls(file.path(path, "R"))
parse_one <- function(filename) {
filename |>
brio::read_lines() |>
purrr::discard(function(x) grepl("^#'", x)) |>
glue::glue_collapse(sep = "\n") |>
downlit::highlight(classes = downlit::classes_pandoc(), code = TRUE, pre = "bla") |>
xml2::read_html() |>

Keybase proof

I hereby claim:

To claim this, I am signing this object: