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

readtext::readtext() fails if package has not been loaded #123

Closed
kbenoit opened this issue Apr 1, 2018 · 3 comments
Closed

readtext::readtext() fails if package has not been loaded #123

kbenoit opened this issue Apr 1, 2018 · 3 comments
Labels

Comments

@kbenoit
Copy link
Collaborator

kbenoit commented Apr 1, 2018

This is because zzz.R has not run .onload() yet to set the options.

R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[R.app GUI 1.70 (7507) x86_64-apple-darwin15.6.0]

[Workspace restored from /Users/kbenoit/.RData]
[History restored from /Users/kbenoit/.Rapp.history]

> DATA_DIR <- system.file("extdata/", package = "readtext")
> rt1 <- readtext::readtext(paste0(DATA_DIR, "txt/UDHR/*"))
Error in if (getOption("readtext_verbosity") >= 3) message(", using glob pattern") : 
  argument is of length zero
@kbenoit kbenoit added the bug label Apr 1, 2018
@amatsuo amatsuo mentioned this issue Apr 30, 2018
@jeroen
Copy link

jeroen commented May 10, 2018

Update: this bug still exists in the new release. To reproduce run in a clean R session:

DATA_DIR <- system.file("extdata", "pdf", "UDHR", package = "readtext")
readtext::readtext(sort(list.files(DATA_DIR, full.names = TRUE, pattern = "\\.pdf$")))

@amatsuo
Copy link
Collaborator

amatsuo commented May 10, 2018

@jeroen
Thanks for the feedback. Should be fixed when a PR is accepted.

@kbenoit
Copy link
Collaborator Author

kbenoit commented May 10, 2018

It’s fixed now, and I added a more comprehensive approach that allows more options to be added. It works in the same as as quanteda::quanteda_options(), which can be set in .Rprofile for instance but will always be initialized if called without the package being attached.

Will re-submit to CRAN asap.

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