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

"String must be an atomic vector" thrown after upgrade to R 3.4.0 #627

Closed
jonlehrer opened this issue May 3, 2017 · 7 comments
Closed

Comments

@jonlehrer
Copy link

I recently upgraded to R 3.4.0. Packages that previously documented fine, now throw the following error:
"Error: String must be an atomic vector"
If I create an empty package and add a roxygen2 documentation block for the hello function, the same error occurs:

Build Messages:
==> devtools::document(roclets=c('rd', 'collate', 'namespace'))

Updating deleteme documentation
Loading deleteme
First time using roxygen2. Upgrading automatically...
Warning: @return [hello.R#19]: requires a value
Warning: @examples [hello.R#22]: requires a value
Error: String must be an atomic vector
Execution halted

Exited with status 1.

Session Info:

sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.5 LTS

Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.0
LAPACK: /usr/lib/lapack/liblapack.so.3.0

locale:
[1] LC_CTYPE=en_CA.UTF-8 LC_NUMERIC=C LC_TIME=en_CA.UTF-8 LC_COLLATE=en_CA.UTF-8
[5] LC_MONETARY=en_CA.UTF-8 LC_MESSAGES=en_CA.UTF-8 LC_PAPER=en_CA.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] deleteme_0.1.0

loaded via a namespace (and not attached):
[1] compiler_3.4.0 tools_3.4.0

@FvD
Copy link

FvD commented May 19, 2017

I have the exact same issue but only in Ubuntu 16.04. On windows after the same upgrade to R 3.4 and on trying to build the documentation for the same package, there is no issue.

@FvD
Copy link

FvD commented May 30, 2017

@jonlehrer the issue dissappeared on my system after installing the package lintr by jimhester. I do not know what roxygen dependency was solved by installing all lintr dependencies, but hopefully this solves the issue for you as well.

@florianm
Copy link

florianm commented Jun 7, 2017

@FvD I have the same bug, your solution works, thanks!

Ubuntu 16.04 LTS, R 3.4.0 (recently upgraded), have lintr installed, ran into this issue when running devtools::deocument() on an R package (vortexR).

@jonlehrer
Copy link
Author

@FvD tried your lintr solution and it worked for me too. Thanks for the tip!

@tpbilton
Copy link
Contributor

I had a similar error message to jonlehrer. Tried installing lintr and didn't work.

After doing some debugging, I found that the problem was with running roxygenise(), where the error was coming when calling the topic_add_keyword() function. It turned out that the str_trim() function was called which is within the stringr package and I was using version 0.6.2 (old version). Comparing the str_trim() function between version 0.6.2 and 1.1.0 reveals that there are some changes to the function. Thus, updating the stringr package solved the problem.

So in short, the dependence that was giving me grief was stringr which needs to be greater than 0.6.2.

@dardisco
Copy link

dardisco commented Jul 4, 2018

Same issue, updating worked as described i.e. install.package("lintr") and install.package("stringr"), thanks to posters above.

@hadley
Copy link
Member

hadley commented Jul 4, 2018

Why do so many of you have stringr 0.6.2? It was released in 2012!

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

6 participants