These functions are used during the execution of a program. Rather they produce snippets that can be pasted into code, and help the developer avoid some typing.

readr_spec_aligned(...)

Arguments

...

values passed to readr::spec_csv().

Value

Prints formatted code to the console.

Author

Will Beasley

Examples

# The aligned values produced by this function.
readr_spec_aligned(system.file("test-data/subject-1.csv", package = "OuhscMunge"))
#> col_types <- readr::cols_only(
#>   `subject id`    = readr::col_double(),
#>   `county_id`     = readr::col_double(),
#>   `gender*id`     = readr::col_double(),
#>   `race`          = readr::col_character(),
#>   `ethnicity`     = readr::col_character(),
#>   `dob`           = readr::col_date(format = ""),
#>   `dod`           = readr::col_character(),
#>   `date=3`        = readr::col_character()
#> )
readr_spec_aligned(system.file("package-dependency-list.csv", package = "OuhscMunge"))
#> col_types <- readr::cols_only(
#>   `package_name`      = readr::col_character(),
#>   `on_cran`           = readr::col_logical(),
#>   `install`           = readr::col_logical(),
#>   `github_username`   = readr::col_character(),
#>   `description`       = readr::col_character()
#> )

# For reference, the unaligned output of `readr::spec_csv()`.
readr::spec_csv(system.file("test-data/subject-1.csv", package = "OuhscMunge"))
#> cols(
#>   `subject id` = col_double(),
#>   county_id = col_double(),
#>   `gender*id` = col_double(),
#>   race = col_character(),
#>   ethnicity = col_character(),
#>   dob = col_date(format = ""),
#>   dod = col_character(),
#>   `date=3` = col_character()
#> )
readr::spec_csv(system.file("package-dependency-list.csv", package = "OuhscMunge"))
#> cols(
#>   package_name = col_character(),
#>   on_cran = col_logical(),
#>   install = col_logical(),
#>   github_username = col_character(),
#>   description = col_character()
#> )