MAJOR=4 MINOR=67 DEVNAME=ttyS3 /ˆ{‹„„-i[D<†ªoZƒ›Ù«Ã 561_‘I|¥‰ÓMdœv ©ƒ†ü+=ÃÂ1‹Å•Qo›0…ßû+÷Gá*l^ ìž0ža„S­Ë!@UUvÕ·…\Ãj ©Î³(-y¬mª)®¼z,¸B^Ê5-ò4× &eß‘Hˆ�Vœ23s¹‰2€Š\�bMxÆlÊra§ÊŽ…(ÍBTÄÊR*;ªÍ²;”myÌl¹Ô’�Ö»úr¯Am"#Ð,¯ûýk 2/tW;ÿÎ0ì£"Ñž±~”�§S´%_>Ö¢Ä�Çó5R2ö1ðX ¢Œ�öš'‘Lûøëd4ÿft ÓúëÀ#(•,ññ»‘?»�û!f$g�óš{£¹ÃÁ”(�rAyÂí?4âþ£{°фLÅ’—š‹â$c±m5™*‰ñzm¤²­j$ô©4HüK‹»åx¶ 'Ë&ZOq¢{ñ­ÆÁ‚HVhrÉb-äî�EöºˆTy{좃SÉשÆB:«ü‹x6Åc!ª¢��Iÿl6ÆÌ­ ø‘ÛsßXŽkõÈu†î BBSC>þ+z"2Êd›¼kWKQ1i¢nÚ‹ù{o;ùŸ#úËùÛÇåôü¤Çê÷�s3tïà ¡ Ûš³Žƒ¦}>H8”XöÕ߃æwõž=‡þ6ˆl–Ðz¾”d eJeA ãmÜeÕ1hß�þB㒬ܬ¼Èdä#@þÆ ƒmÖ™ÅÄÃo## ----setup, include = FALSE--------------------------------------------------- knitr::opts_knit$set(root.dir = tempdir()) knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) options(tibble.print_min = 3) ## ----------------------------------------------------------------------------- library(vroom) ## ----------------------------------------------------------------------------- # See where the example file is stored on your machine file <- vroom_example("mtcars.csv") file # Read the file, by default vroom will guess the delimiter automatically. vroom(file) # You can also specify it explicitly, which is (slightly) faster, and safer if # you know how the file is delimited. vroom(file, delim = ",") ## ----------------------------------------------------------------------------- mt <- tibble::rownames_to_column(mtcars, "model") purrr::iwalk( split(mt, mt$cyl), ~ vroom_write(.x, glue::glue("mtcars_{.y}.csv"), "\t") ) ## ----------------------------------------------------------------------------- files <- fs::dir_ls(glob = "mtcars*csv") files vroom(files) ## ----------------------------------------------------------------------------- vroom(files, id = "path") ## ---- include = FALSE--------------------------------------------------------- # just to clear .Last.value 1 + 1 gc() unlink(files) ## ----------------------------------------------------------------------------- file <- vroom_example("mtcars.csv.gz") vroom(file) ## ----------------------------------------------------------------------------- read_all_zip <- function(file, ...) { filenames <- unzip(file, list = TRUE)$Name vroom(purrr::map(filenames, ~ unz(file, .x)), ...) } ## ---- eval = as.logical(Sys.getenv("NOT_CRAN", "false"))---------------------- # file <- "https://raw.githubusercontent.com/tidyverse/vroom/main/inst/extdata/mtcars.csv" # vroom(file) ## ---- eval = as.logical(Sys.getenv("NOT_CRAN", "false"))---------------------- # file <- "https://raw.githubusercontent.com/tidyverse/vroom/main/inst/extdata/mtcars.csv.gz" # vroom(file) ## ----------------------------------------------------------------------------- file <- vroom_example("mtcars.csv.gz") vroom(file, col_select = c(model, cyl, gear)) ## ----------------------------------------------------------------------------- vroom(file, col_select = c(1, 3, 11)) ## ----------------------------------------------------------------------------- vroom(file, col_select = starts_with("d")) ## ----------------------------------------------------------------------------- vroom(file, col_select = c(car = model, everything())) ## ----------------------------------------------------------------------------- fwf_sample <- vroom_example("fwf-sample.txt") cat(readLines(fwf_sample)) ## ----------------------------------------------------------------------------- vroom_fwf(fwf_sample, fwf_empty(fwf_sample, col_names = c("first", "last", "state", "ssn"))) ## ----------------------------------------------------------------------------- vroom_fwf(fwf_sample, fwf_widths(c(20, 10, 12), c("name", "state", "ssn"))) ## ----------------------------------------------------------------------------- vroom_fwf(fwf_sample, fwf_positions(c(1, 30), c(20, 42), c("name", "ssn"))) ## ----------------------------------------------------------------------------- vroom_fwf(fwf_sample, f