Skip to content

Instantly share code, notes, and snippets.

Nested list:

  1. one
  2. two
  3. three
    1. sub
    2. sub2
    3. sub3
  4. four
@gaborcsardi
gaborcsardi / issue.md
Created November 3, 2023 21:05
upkeep issue

Pre-history

  • usethis::use_readme_rmd()
  • usethis::use_roxygen_md()
  • usethis::use_github_links()
  • usethis::use_pkgdown_github_pages()
  • usethis::use_tidy_github_labels()
  • usethis::use_tidy_style()
  • urlchecker::url_check()
@gaborcsardi
gaborcsardi / Dockerfile
Last active September 2, 2023 11:29
Dockerfile pak example
FROM ubuntu:22.04
# install R & pak, set up repos and PPM
RUN apt-get update && \
apt-get install -y curl && \
curl -Ls https://github.com/r-lib/rig/releases/download/latest/rig-linux-$(arch)-latest.tar.gz | \
tar xz -C /usr/local && \
rig add release
# install local file with pak
@gaborcsardi
gaborcsardi / answer.md
Created July 29, 2023 07:44
arrow R package binary and system requirements
@gaborcsardi
gaborcsardi / git.R
Last active April 25, 2023 22:06
git protocol example from R
h <- curl::new_handle()
curl::handle_setheaders(
handle = h,
"User-Agent" = "git/2.38.1"
)
res1 <- curl::curl_fetch_memory(
handle = h,
"https://github.com/r-lib/pak.git/info/refs?service=git-upload-pack"
)
## From https://github.com/szilard/benchm-dplyr-dt, thanks Szilárd!
library(dplyr)
n <- 100000000
m <- 1000000
d <- data.frame(x = sample(m, n, replace=TRUE), y = runif(n))
dm <- data.frame(x = sample(m))
@gaborcsardi
gaborcsardi / Dockerfile
Last active October 8, 2022 17:19
Dockerfile for R-devel with clang 15 and libc++-15
FROM tuxmake/clang-15
RUN apt-get update -y ; apt-get install -y curl
RUN curl -Ls https://github.com/r-lib/rig/releases/download/latest/rig-linux-latest.tar.gz | tar xz -C /usr/local
RUN rig add devel
RUN mkdir ~/.R
FROM ubuntu:20.04
ENV R_VERSION 4.1.2
RUN apt-get -y update && \
apt-get -y install wget gdebi-core && \
wget https://cdn.rstudio.com/r/ubuntu-2004/pkgs/r-${R_VERSION}_1_amd64.deb && \
gdebi --non-interactive r-${R_VERSION}_1_amd64.deb && \
rm r-${R_VERSION}_1_amd64.deb && \
apt-get -y autoremove gdebi-core && \
@gaborcsardi
gaborcsardi / Pkgdown deploy from Travis.md
Last active November 17, 2021 13:41
Walkthrough: deploy a pkgdown site from Travis

Run usethis::use_pkgdown_travis()

usethis::use_pkgdown_travis()
✔ Setting active project to '/Users/gaborcsardi/works/ps'Adding 'docs/' to '.gitignore'Set up deploy keys by running `travis::use_travis_deploy()`Insert the following code in '.travis.yml'
  before_cache: Rscript -e 'remotes::install_cran("pkgdown")'
@gaborcsardi
gaborcsardi / cran-over-time.R
Last active July 18, 2020 19:21
Size of the CRAN R package repository over time
library(jsonlite)
## Download
pkgs <- fromJSON("http://crandb.r-pkg.org/-/events")
## Filter
na_pkgs <- unique(pkgs$name[ is.na(pkgs$date) ])
events <- pkgs[ ! pkgs$name %in% na_pkgs, c("date", "name", "event")]