Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean error messages & documentation following deprecations #95

Merged
merged 5 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions R/cite.r
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cite <- function(x, ...) UseMethod("cite")
#' @rdname cite
#' @title Citation for a survey
#'
#' @description Gets a full citation for a [survey()]. If quiet is FALSE (default)
#' @description Gets a full citation for a [survey()].
#'
#' @param x a character vector of surveys to cite
#' @param ... ignored
Expand All @@ -27,15 +27,17 @@ cite.survey <- function(x, ...) {

#' @title Citation for a survey
#'
#' @description Gets a full citation for a [survey()]. If quiet is FALSE (default)
#' @description Gets a full citation for a [survey()].
#'
#' @param x a character vector of surveys to cite
#' @return citation as bibentry
#' @importFrom utils bibentry
#' @importFrom httr GET content
#' @examples
#' data(polymod)
#' get_citation(polymod)
#' citation <- get_citation(polymod)
#' print(citation)
#' print(citation, style = "bibtex")
#' @export
get_citation <- function(x) {

Expand Down
4 changes: 2 additions & 2 deletions R/contact_matrix.r
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ contact_matrix <- function(survey, countries = NULL, survey.pop, age.limits, fil
if (!missing(n)) {
warning(
"The 'n' option is being deprecated and will be removed ",
"following version 0.2.0. Please see the ",
"in version 1.0.0. Please see the ",
"'Bootstrapping' section in the vignette for an ",
"alternative approach."
)
Expand All @@ -73,7 +73,7 @@ contact_matrix <- function(survey, countries = NULL, survey.pop, age.limits, fil
if (!missing(bootstrap)) {
warning(
"The 'bootstrap' option is being deprecated and will be removed ",
"following version 0.2.0. Please use the 'sample.participants'",
"in version 1.0.0. Please use the 'sample.participants'",
" option instead."
)
if (missing(sample.participants)) sample.participants <- bootstrap
Expand Down
2 changes: 1 addition & 1 deletion R/get_survey.r
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ get_survey <- function(survey, ...) {
if (!is.null(new_survey$reference)) {
message(
"Using ", new_survey$reference$title,
". To cite this in a publication, use the 'cite' function"
". To cite this in a publication, use the 'get_citation()' function"
)
}

Expand Down
2 changes: 1 addition & 1 deletion R/load_survey.r
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ load_survey <- function(files, ...) {
if (!is.null(new_survey$reference)) {
message(
"Using ", new_survey$reference$title,
". To cite this in a publication, use the 'cite' function"
". To cite this in a publication, use the 'get_citation()' function"
)
}

Expand Down
2 changes: 1 addition & 1 deletion man/cite.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/get_citation.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.