# https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/delayedAssign
# The code of any pkg, e.g. r2dii.data -----------------------------------------
# R/abcd_demo.R
abcd_demo <- head(mtcars)
delayedAssign("ald_demo", {
warning("`ald_demo` is retired. Instead use `abcd_demo`")
abcd_demo
})
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
# source("https://bit.ly/use_pin") | |
library(pins) | |
use_pin <- function(x, name, board = board_local(), overwrite = FALSE) { | |
if (!pin_exists(board, name) || overwrite) pin_write(board, x, name) | |
pin_read(board, name) | |
} |
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(rvest) | |
library(chromote) # remotes::install_github("rstudio/chromote") | |
library(countrycode) | |
library(readr) | |
# ------------------------------------------------------------------------------ | |
em_url <- "https://www.europages.co.uk/DAZUN-GMBH/00000005340662-639906001.html" |
Here: https://bit.ly/3KuXgpE
--
On my local machine
url <- "https://esastar-emr.sso.esa.int/PublicEntityDir/PublicEntityDirGridSme?term=&isForRegister=False&isForEmits=True&grid-page=3"
jsonlite::fromJSON(url)
#> Error in open.connection(con, "rb"): SSL certificate problem: unable to get local issuer certificate
- Announce on #coding.
- Add meetup date, title and link to the invitation on 2dii's calendar.
Here: https://git.io/JXbat
--
library(fs)
path <- fs::path_home("tmp", "inputs", "Loans_results_company.rda")
file_exists(path)
#> /home/mauro/tmp/inputs/Loans_results_company.rda
library(B)
"/path/to/inputs" %>%
list.files() %>%
st_read() %>%
st_prep_loans() %>%
st_compute_results("loans") %>%
st_show_logs() %>%
st_write("/path/to/output")
library(A)
input_path_project_specific <- "/home/me/path/a"
input_path_project_agnostic <- "/home/me/path/b"
output_path <- "/home/me/path/c"
run_prep_calculation_loans(
input_path_project_specific,
input_path_project_agnostic,
Here: https://git.io/JPRtG
# This is how I renamed master to main in all my repos, in bulk on GitHub
library(purrr)
library(glue)
library(gh)
rename_master_to_main <- function(repos, owner) {
Great post! https://github.com/2DegreesInvesting/resources/issues/283
The writing is super clear. These are the only tiny details that caught my eye:
- The pseudo code uses
>
but likley you meant%>%
.
NewerOlder