Skip to content

Instantly share code, notes, and snippets.

View benjaminguinaudeau's full-sized avatar

Benjamin Guinaudeau benjaminguinaudeau

View GitHub Profile
@benjaminguinaudeau
benjaminguinaudeau / init.R
Last active August 14, 2019 16:37
This gist installs all the R-packages I use. This is most particularly useful when a fresh installation of R is required.
# The line below corresponds to all packages, I use at least twice in my documents
# This list has been created using pkguse (remotes::install_github("mkearney/pkguse"))
package <- c("base64enc", "blogdown", "corrr",
"countrycode", "cowplot", "devtools",
"dplyr", "dummies", "fs", "furrr",
"future", "ggcorrplot", "ggplot2", "glue",
"janitor", "kableExtra", "keras", "keyring",
"knitr", "lubridate", "magrittr", "numbers",
"pacman", "purrr", "R.utils", "R6", "readr",
"readxl", "reticulate", "rio", "rlang", "rmarkdown",
library(dplyr)
do_if <- function(.data, condition, call){
if(condition){
.x <- .data
call_str <- call %>%
as.character %>%
.[2]