Skip to content

Instantly share code, notes, and snippets.

View maelle's full-sized avatar

Maëlle Salmon maelle

View GitHub Profile
@maelle
maelle / ro_docs.R
Created June 12, 2019 12:00
Add docs URL
docs <- gh::gh('/users/ropensci-docs/repos?per_page=100', .limit = 1000)
repos <- ghrecipes::get_repos("ropensci")
repos2 <- ghrecipes::get_repos("ropenscilabs")
repos <- dplyr::bind_rows(repos[, "name"], repos2[, "name"])
docs <- tibble::tibble(name = purrr::map_chr(docs, "name"))
repos <- tidyr::separate(repos, name, "/", into = c("org", "name"))
docs <- dplyr::left_join(docs, repos, by = "name")
docs <- docs[!is.na(docs$org),]
@maelle
maelle / ro_topics.R
Created June 12, 2019 11:30
Add r, rstats and r-package topics to rOpenSci packages
repos <- ghrecipes::get_repos("ropensci")
repos <- dplyr::mutate(repos,
name = stringr::str_remove(name,
"ropensci\\/"))
# archived
repos <- dplyr::filter(repos, !is_archived)
# are packages
repos$is_pkg <- purrr::map_lgl(repos$name,
{
"packages": [
{
"name": "auk",
"description": "eBird Data Extraction and Processing in R",
"details": "Extract and process bird sightings records from eBird \n (<http://ebird.org>), an online tool for recording bird observations. \n Public access to the full eBird database is via the eBird Basic Dataset \n (EBD; see <http://ebird.org/ebird/data/download> for access), a downloadable \n text file. This package is an interface to AWK for extracting data from the \n EBD based on taxonomic, spatial, or temporal filters, to produce a \n manageable file size that can be imported into R.",
"maintainer": "Matthew Strimas-Mackey",
"keywords": "dataset, ebird",
"github": "https://github.com/CornellLabofOrnithology/auk",
"status": {
@maelle
maelle / demo_reprex.md
Created September 29, 2018 14:18
A demo of posting a reprex
@maelle
maelle / .gistr
Created September 28, 2018 19:03
my reprex
gistr
@maelle
maelle / .gistr
Created September 28, 2018 18:57
my reprex
gistr
@maelle
maelle / myreprex_reprex.md
Created September 28, 2018 18:30
my reprex
@maelle
maelle / update.R
Created August 29, 2018 14:43
How to update headers
``` r
library("magrittr")
homogeneize <- function(path){
path %>%
readLines(encoding = "UTF-8") %>%
blogdown:::split_yaml_body() %>%
.$body %>%
commonmark::markdown_xml(extensions = TRUE) %>%
xml2::read_xml() -> post_xml
@maelle
maelle / roblog_headers.R
Last active August 29, 2018 14:16
How to get headers by file
``` r
roblog <- "C:\\Users\\Maelle\\Documents\\ropensci\\roweb2\\content\\blog"
all_posts <- fs::dir_ls(roblog, regexp = "*.md")
all_posts <- all_posts[all_posts != "_index.md"]
library("magrittr")
# Headers
get_headers <- function(path){
@maelle
maelle / slides.Rmd
Created August 23, 2018 10:11
Mi codigo abieRto
---
title: "¡Mejo`r icon::fa('r-project')` ciencia con rOpenSci!"
subtitle: "Maëlle Salmon <br/> [`r icon::fa('twitter')`](https://twitter.com/ropensci) ropensci [`r icon::fa('github')`](https://github.com/ropensci) ropensci [`r icon::fa('globe')`](https://ropensci.org) ropensci.org"
date: "2018/09/05"
output:
xaringan::moon_reader:
css: ["default", "metropolis", "metropolis-fonts", "my-theme.css"]
lib_dir: libs
nature:
highlightStyle: github