diff --git a/r/R/csv.R b/r/R/csv.R index 89d2db4cb15a0..afec9e6fa6563 100644 --- a/r/R/csv.R +++ b/r/R/csv.R @@ -743,6 +743,12 @@ TimestampParser$create <- function(format = NULL) { #' (b) a character vector of [strptime][base::strptime()] parse strings; or #' (c) a list of [TimestampParser] objects. #' +#' @examples +#' tf <- tempfile() +#' on.exit(unlink(tf)) +#' writeLines('x\n1\nNULL\n2\nNA', tf) +#' read_csv_arrow(tf, convert_options = csv_convert_options(null_values = c("", "NA", "NULL"))) +#' open_csv_dataset(tf, convert_options = csv_convert_options(null_values = c("", "NA", "NULL"))) #' @export csv_convert_options <- function(check_utf8 = TRUE, null_values = c("", "NA"), diff --git a/r/man/csv_convert_options.Rd b/r/man/csv_convert_options.Rd index 3dbbdea7abf96..4fd6eac1c3e82 100644 --- a/r/man/csv_convert_options.Rd +++ b/r/man/csv_convert_options.Rd @@ -60,3 +60,10 @@ starting from the beginning of this vector. Possible values are \description{ CSV Convert Options } +\examples{ +tf <- tempfile() +on.exit(unlink(tf)) +writeLines('x\n1\nNULL\n2\nNA', tf) +read_csv_arrow(tf, convert_options = csv_convert_options(null_values = c("", "NA", "NULL"))) +open_csv_dataset(tf, convert_options = csv_convert_options(null_values = c("", "NA", "NULL"))) +}