Changed my mind about update vs download

This commit is contained in:
philbastian 2020-06-23 13:37:10 -04:00
parent 8cdc36995e
commit 81902bac25
5 changed files with 5 additions and 61 deletions

View File

@ -1,6 +1,6 @@
# Generated by roxygen2: do not edit by hand
S3method(update,mc)
export(.onLoad)
export(country.data)
export(download.mc)
export(match.country)

View File

@ -1,7 +1,7 @@
#' Download the MatchCountry tables from Github
#'
#' @param match Path to the match csv file
#' @param countrydata Path to the countrydata csv file
#' @param match Path to the master match csv file
#' @param countrydata Path to the master countrydata csv file
#'
#' This updates the Match Country files in the library to their current versions. It will overwrite
#' the existing files, so this should be used with care if reproducability of older analyses is

View File

@ -1,27 +0,0 @@
#' Download the MatchCountry tables from Github
#'
#' @param match Path to the master match csv file
#' @param countrydata Path to the master countrydata csv file
#'
#' This updates the Match Country files in the library to their current versions. It will overwrite
#' the existing files, so this should be used with care if reproducability of older analyses is
#' a priority. You can also use this to make your own custom files for matching.
#'
#' @examples
#' update.mc()
#'
#' @export
update.mc <- function(match = "https://raw.githubusercontent.com/philbastian/matchcountry/master/inst/extdata/match.csv",
countrydata = "https://raw.githubusercontent.com/philbastian/matchcountry/master/inst/extdata/countrydata.csv") {
i <- readLines(ii <- url(match), encoding = "UTF-8", warn = FALSE)
j <- readLines(jj <- url(countrydata), encoding = "UTF-8", warn = FALSE)
close(ii)
close(jj)
writeLines(i, system.file("extdata", "match.csv", package = "matchcountry"))
writeLines(j, system.file("extdata", "countrydata.csv", package = "matchcountry"))
read.mc()
}

View File

@ -12,9 +12,9 @@ download.mc(
)
}
\arguments{
\item{match}{Path to the match csv file}
\item{match}{Path to the master match csv file}
\item{countrydata}{Path to the countrydata csv file
\item{countrydata}{Path to the master countrydata csv file
This updates the Match Country files in the library to their current versions. It will overwrite
the existing files, so this should be used with care if reproducability of older analyses is

View File

@ -1,29 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/update.mc.R
\name{update.mc}
\alias{update.mc}
\title{Download the MatchCountry tables from Github}
\usage{
\method{update}{mc}(
match = "https://raw.githubusercontent.com/philbastian/matchcountry/master/inst/extdata/match.csv",
countrydata = "https://raw.githubusercontent.com/philbastian/matchcountry/master/inst/extdata/countrydata.csv"
)
}
\arguments{
\item{match}{Path to the master match csv file}
\item{countrydata}{Path to the master countrydata csv file
This updates the Match Country files in the library to their current versions. It will overwrite
the existing files, so this should be used with care if reproducability of older analyses is
a priority. You can also use this to make your own custom files for matching.}
}
\description{
Download the MatchCountry tables from Github
}
\examples{
update.mc()
}