Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Character vectors lose leading zeroes #26

Open
1 of 3 tasks
eliocamp opened this issue Dec 16, 2019 · 1 comment
Open
1 of 3 tasks

Character vectors lose leading zeroes #26

eliocamp opened this issue Dec 16, 2019 · 1 comment
Labels

Comments

@eliocamp
Copy link

Please specify whether your issue is about:

  • a possible bug
  • a question about package functionality
  • a suggested code or documentation change, improvement to the code, or feature request

Writing and reading seem to mess up character vectors with leading zeroes.

data <- data.frame(x = 1, y = c("10", "05"))
file <- tempfile()
csvy::write_csvy(data, file, name = "abc")
csvy::read_csvy(file)
#>   x  y
#> 1 1 10
#> 2 1  5
str(csvy::read_csvy(file))
#> 'data.frame':    2 obs. of  2 variables:
#>  $ x: num  1 1
#>  $ y: chr  "10" "5"
#>   ..- attr(*, "levels")= chr  "05" "10"
#>  - attr(*, "profile")= chr "tabular-data-package"
#>  - attr(*, "name")= chr "abc"

Created on 2019-12-16 by the reprex package (v0.3.0)

@leeper leeper added the bug label Dec 20, 2019
@Cedev
Copy link

Cedev commented Jul 6, 2023

read_csvy does not use the fields metadata at all when reading columns: https://github.com/leeper/csvy/blob/master/R/read_csvy.R#L68C1-L71C6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants