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
#### blockCV old | |
library(raster) | |
x <- raster(system.file("external/rlogo.grd", package="raster")) | |
resolution = 10000 | |
ybin = 3 | |
xbin = 3 |
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
export TFC_TOKEN=<CHANGEME> # TF cloud token | |
export WORKSPACE_ID=<CHANGEME> # old TF cloud Workspace ID | |
export WORKSPACE_ID_NEW=<CHANGEME> # new OTF workspace ID | |
export TOKEN_REMOTE_BACKEND=<CHANGEME> # OTF token | |
export REMOTE_BACKEND_URL=<CHANGEME> # OTF URL | |
### START | |
HTTP_RESPONSE=$(curl \ | |
--header "Authorization: Bearer "$TFC_TOKEN"" \ |
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
### DEPENDENCIES | |
# - curl | |
# - jq | |
### VARIABLES | |
export REPO_NAME=FIXME | |
export ORG_NAME=FIXME | |
export SLEEP_TIME=15 | |
export TOKEN=FIXME # empty scopes are sufficient |
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
FROM ubuntu:focal | |
# set ENV variables | |
ENV LC_ALL=en_US.UTF-8 | |
ENV LANG=en_US.UTF-8 | |
ENV TERM=xterm | |
ENV DEBIAN_FRONTEND=noninteractive | |
# locale ----------------------------------------------------------------------# | |
RUN apt update \ |
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
# because base::file.rename() is a pain across OS | |
requireNamespace("fs", quietly = TRUE) | |
# download cluto zip file | |
temp = tempfile() | |
utils::download.file("http://glaros.dtc.umn.edu/gkhome/fetch/sw/cluto/cluto-2.1.2a.zip", temp, quiet = TRUE) | |
utils::unzip(temp, files = c("cluto-2.1.2/Linux-x86_64/vcluster", "cluto-2.1.2/MSWIN-x86_64/vcluster.exe")) | |
unlink(temp) |
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(tidyverse) | |
library(htmltab) | |
library(lubridate) | |
library(pkgsearch) | |
list_repos = httr::content(httr::GET("https://api.github.com/orgs/mlr-org/repos?per_page=100")) | |
list_repos_v = unlist(lapply(list_repos, function(x) x$name)) | |
repos_mlr3 = grep("mlr3", list_repos_v, value = TRUE) | |
# add non-mlr3 repos |
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
## ----mlr3-config, echo = FALSE--------------------------------------------------------------------------- | |
lgr::get_logger("bbotk")$set_threshold("warn") | |
lgr::get_logger("mlr3")$set_threshold("warn") | |
## ----example, fig.show="hide"---------------------------------------------------------------------------- | |
library("mlr3verse", quietly = TRUE) | |
set.seed(42) | |
# example tasks |
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
{ | |
"version": "0.9.0", | |
"description": "The R installation manage: Install, remove, configure R versions.", | |
"homepage": "https://github.com/pat-s/rcli", | |
"license": "LGPL-3", | |
"url": "https://github.com/pat-s/rcli/releases/download/0.9.0/rcli", | |
"bin": "rcli", | |
"checkver": "github" | |
} |
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
if (requireNamespace(c("callr", "git2r", "gert", "cli"), quietly = TRUE)) { | |
has_git = git2r::in_repository() | |
if (has_git && Sys.getenv("RSTUDIO") == 1) { | |
cli::cli_text("Running | |
{.code gert::git_pull(verbose = FALSE, prune = TRUE, rebase = TRUE)} | |
in the background.") | |
callr::r_bg(function() { | |
gert::git_pull(verbose = FALSE, prune = TRUE, rebase = TRUE) | |
}, | |
stdout = out <- tempfile(), stderr = err <- tempfile())$wait() |
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
if (requireNamespace(c("callr", "git2r"), quietly = TRUE)) { | |
has_git = git2r::in_repository() | |
if (has_git) { | |
message("Running `git2r::pull()` in the background.") | |
callr::r_bg(function() {git2r::pull()})$wait()$get_result() | |
} | |
} |
NewerOlder