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

read_csv_cleaned() function #41

Open
wibeasley opened this issue Oct 25, 2017 · 0 comments
Open

read_csv_cleaned() function #41

wibeasley opened this issue Oct 25, 2017 · 0 comments

Comments

@wibeasley
Copy link
Member

wibeasley commented Oct 25, 2017

Does this function have enough use to include in the package?

read_csv_cleaned <- function( path, col_types, clean = TRUE ) {
  if( clean ) {
    content   <- readr::read_file(path)
    cleaned   <- clean_to_ascii(content)
    readr::read_csv(cleaned, col_types=col_types)
  } else {
    readr::read_csv(path, col_types=col_types)
  }
}

It's been very useful with ETO extracts in miechv 3:
https://github.com/OuhscBbmc/miechv-3/blob/a02b27819e72a30abdeecc5e3b90f2d2c5945e9a/manipulation/osdh/ellis/common-ellis.R#L20-L31

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

No branches or pull requests

1 participant