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

exportDataset throwing an error #581

Open
jack-nicol opened this issue Aug 26, 2021 · 3 comments
Open

exportDataset throwing an error #581

jack-nicol opened this issue Aug 26, 2021 · 3 comments

Comments

@jack-nicol
Copy link

I'm attempting a simple export, but keep having a break occur (example below):

library(crunch)
login()
ds <- loadDataset("SURVEY NAME")
exportDataset(ds)
Error in match.arg(format, choices = names(exporters)) : 
  'arg' must be of length 1

not sure why this no longer works, but I'm wondering if exportDataset now needs the format option to be explicitly declared?

@jack-nicol
Copy link
Author

looks like the issue is that file and format arguments must be declared or this function will break. not sure its a real issue in need of fixing

@gergness
Copy link
Contributor

Hm, yeah, I think file has always been required, and the code for format hasn't changed recently, but possibly a change to R broke it. It would be pretty easy to fix.

I think it should guess the format from the filename by default, (eg file = "data.csv" would be csv, and file = "data.sav" would be spss), does that sound right to you?

@jack-nicol
Copy link
Author

yes, that does. I actually think more explicit error messages here would be better, so that if format is not declared, the user is prompted to pick either csv or spss for that argument, and then if no file is declared the default is exactly as you described, so long as the format is chosen.

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

No branches or pull requests

2 participants