R/NAME_download_osf.R

Defines functions download_osf

Documented in download_osf

#' A function to download data from www.osf.io
#'
#' A simple wrapper around download for not having to type a rather cumbersome download link
#'
#' This is a convenience function to download data from a specified OSF repo. Internet access is needed.
#'
#'
#' @param repo short link to repo, eg. "meyhp" (chr)
#' @return data as data.frame
#'
#' @importFrom utils read.csv
#'

#' @export
download_osf <- function(repo){
  osf_link <- paste0("https://osf.io/", repo, "/?action=download")
  out <- read.csv(osf_link)
  return(out)
}
sebastiansauer/prada documentation built on Jan. 17, 2024, 11:05 a.m.