@@ -193,16 +193,22 @@ fetch_classic <- function(epidata_call, fields = NULL, disable_data_frame_parsin
193
193
return (response_content $ epidata )
194
194
}
195
195
196
- # ' Fetches the data and returns the CSV text
196
+ # ' Fetches the data and returns a tibble or an `epidata_csv`
197
197
# '
198
198
# ' @param epidata_call an instance of `epidata_call`
199
199
# ' @param fields filter fields
200
- # ' @importFrom httr stop_for_status content
201
- # ' @importFrom rlang abort
200
+ # ' @param disable_date_parsing Boolean. Optionally, `TRUE` to disable parsing of
201
+ # ' columns we expect to be dates, keeping them as character columns instead.
202
+ # ' `FALSE` (the default) to parse these columns into `Date` vectors.
203
+ # ' @param disable_tibble_output Boolean. Optionally, `TRUE` to output a
204
+ # ' character vector with the `epidata_csv` class (which provides a custom
205
+ # ' `print` method). `FALSE` (the default) to output a tibble.
202
206
# ' @return
203
- # ' - For `fetch_csv`: a string containing CSV text, with the
204
- # ' `"epidata_csv"` class added
207
+ # ' - For `fetch_csv`: a tibble, or `epidata_csv` if requested with
208
+ # ' `disable_tibble_output = TRUE`
205
209
# '
210
+ # ' @importFrom httr stop_for_status content
211
+ # ' @importFrom rlang abort
206
212
fetch_csv <- function (epidata_call , fields = NULL , disable_date_parsing = FALSE , disable_tibble_output = FALSE ) {
207
213
stopifnot(inherits(epidata_call , " epidata_call" ))
208
214
stopifnot(is.null(fields ) || is.character(fields ))
0 commit comments