Skip to content

Commit

Permalink
change order of errors/warnings, and nocov tags
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenturner committed Aug 18, 2024
1 parent be378ec commit ae2b6a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/biorecap.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ get_preprints <- function(subject="all", baseurl="https://connect.biorxiv.org/bi
#'
add_prompt <- function(preprints, ...) {

if(!inherits(preprints, "preprints")) warning("Expecting a data frame of class 'preprints' returned from get_preprints().")
if (!inherits(preprints, "data.frame")) stop("Expecting a data frame.")
if (!"title" %in% colnames(preprints)) stop("Expecting a column named 'title' in the data frame.")
if (!"abstract" %in% colnames(preprints)) stop("Expecting a column named 'abstract' in the data frame.")
if(!inherits(preprints, "preprints")) warning("Expecting a data frame of class 'preprints' returned from get_preprints().")

preprints <-
preprints |>
Expand Down Expand Up @@ -150,6 +150,7 @@ add_summary <- function(preprints, model="llama3.1") {
if (!inherits(preprints, "data.frame")) stop("Expecting a data frame.")
if (!"prompt" %in% colnames(preprints)) stop("Expecting a column named 'prompt' in the data frame.")

#nocov start
suppressMessages({
preprints <-
preprints |>
Expand All @@ -163,6 +164,7 @@ add_summary <- function(preprints, model="llama3.1") {

class(preprints) <- c("preprints_summary", class(preprints))
return(preprints)
#nocov end
}


Expand Down

0 comments on commit ae2b6a6

Please sign in to comment.