Skip to content

Instantly share code, notes, and snippets.

View b-kennedy0's full-sized avatar

Bradley Kennedy b-kennedy0

View GitHub Profile
@b-kennedy0
b-kennedy0 / end-of-script.R
Created August 5, 2021 17:23
Notify using Integromat that your R Markdown script has finished.
```{r end of scipt, include=FALSE} # include=FALSE so not printed in your markdown
library(httr)
script_name <- "study#" # Put your script name here
url <- paste("https://hook.integromat.com/your_webhood_key_here/?script=",
script_name, sep = '')
POST(url)
```
@b-kennedy0
b-kennedy0 / r-package_installer.R
Last active May 20, 2020 11:01
Tidy code that will: (1) state which packages are required (2) list which ones aren’t already installed. (3) install the new packages. (4) load (library) them. (5) check for updates for all packages.
list_of_packages<-c("tidyr","psych","ggplot2","here")
new.packages <- list_of_packages[!(list_of_packages %in% installed.packages()[,"Package"])]
if(length(new.packages))install.packages(new.packages)
lapply(list_of_packages, library, character.only = TRUE)
update.packages(ask=FALSE, repos = "https://cloud.r-project.org")