Skip to content

Commit

Permalink
Merge pull request #325 from vubiostat/cran-release-318
Browse files Browse the repository at this point in the history
Changes required by win-builder devel #318
  • Loading branch information
spgarbet authored Jan 31, 2024
2 parents 6527951 + 940ca16 commit ac4240e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
6 changes: 3 additions & 3 deletions R/documentation-common-args.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ NULL
#' @param na A named `list` of user specified functions to determine if the
#' data is NA. This is useful when data is loaded that has coding for NA, e.g.
#' -5 is NA. Keys must correspond to a truncated REDCap field type, i.e.
#' {date_, datetime_, datetime_seconds_, time_mm_ss, time_hh_mm_ss, time, float,
#' date_, datetime_, datetime_seconds_, time_mm_ss, time_hh_mm_ss, time, float,
#' number, calc, int, integer, select, radio, dropdown, yesno, truefalse,
#' checkbox, form_complete, sql, system}. The function will be provided the
#' checkbox, form_complete, sql, system. The function will be provided the
#' variables (x, field_name, coding). The function must return a vector of
#' logicals matching the input. It defaults to [isNAorBlank()] for all
#' entries.
Expand All @@ -61,7 +61,7 @@ NULL
#' @param assignment A named `list` of functions. These functions are provided, field_name,
#' label, description and field_type and return a list of attributes to assign
#' to the column. Defaults to creating a label attribute from the stripped
#' HTML and UNICODE raw label and scanning for units={"UNITS"} in description
#' HTML and UNICODE raw label and scanning for units=\{"UNITS"\} in description

NULL

Expand Down
9 changes: 8 additions & 1 deletion R/makeApiCall.R
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,15 @@ makeApiCall <- function(rcon,
}

# Helper function to convert responses to character strings without crashing.
as.data.frame.response <- function(x, stringsAsFactors=FALSE, na.strings = "", ...)
as.data.frame.response <- function(x, row.names=NULL, optional=FALSE, ...)
{
# Setting defaults, necessary because cannot change S3 interface
extra <- list(...)
stringsAsFactors <- extra$stringsAsFactors
if(is.null(stringsAsFactors)) stringsAsFactors <- FALSE
na.strings <- extra$na.strings
if(is.null(na.strings)) na.strings <- ""

enc <- if(grepl("charset", x$headers[["Content-Type"]]))
toupper(sub('.*charset=([^;]+).*', '\\1', x$headers[["Content-Type"]])) else
'ISO-8859-1' # [Default if unspecified](https://www.w3.org/International/articles/http-charset/index)
Expand Down
4 changes: 2 additions & 2 deletions man/fieldCastingFunctions.Rd

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

6 changes: 3 additions & 3 deletions man/recordsTypedMethods.Rd

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

0 comments on commit ac4240e

Please sign in to comment.