jftnese
October 13, 2023, 10:40pm
1
I am sometimes unable to render quarto documents for my quarto website that I was previously able to render. When I try, it gives me the following error:
Error in if (n == 1) word else paste(word, "s", sep = "") :
the condition has length > 1
Calls: source ... sprintf -> <Anonymous> -> nplural -> paste -> plural
Execution halted
I noticed I also get this error when I restart my R session.
Error in if (n == 1) word else paste(word, "s", sep = "") :
the condition has length > 1
So when I googled, I found this code here: renv source: R/utils.R in the plural()
function.
I am not sure what this function does, or why it is causing my renders to fail, but any help would be greatly appreciated!
This is related to a previous post: quarto website `qmd`s not rendering
cderv
October 16, 2023, 9:54am
2
Probably related to this renv issue
opened 08:04AM - 18 Aug 23 UTC
closed 06:57PM - 04 Dec 23 UTC
bug
I have a project with renv 1.0.2. It seems to work fine in one environment, but … inside a docker image it generates the following error when R is starting:
<details><summary>renv::restore()</summary>
```
$ Rscript -e 'renv::restore()'
# Bootstrapping renv 1.0.2 ---------------------------------------------------
- Downloading renv ... OK
- Installing renv ... OK
- One or more packages recorded in the lockfile are not installed.
- Use `renv::status()` for more details.
The following package(s) will be updated:
...
The following loaded package(s) have been updated:
- BiocManager
Restart your R session to use the new versions.
Warning message:
failed to resolve remote 'GuangchuangYu/treeio'; skipping
```
</details>
```
$ R -e 'bookdown::render_book( "index.Rmd", "bookdown::gitbook", output_dir = "public" )'
R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (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.
- Project '/builds/PMDA/training/the_book_of_flowers' loaded. [renv 1.0.2]
Error in if (n == 1) word else paste(word, "s", sep = "") :
the condition has length > 1
Calls: source ... sprintf -> <Anonymous> -> nplural -> paste -> plural
In addition: Warning messages:
1: In if (grepl("-display$", label)) return(TRUE) :
the condition has length > 1
2: In if (grepl("-display$", label)) return(TRUE) :
the condition has length > 1
Execution halted
```
I tried to add the following lines to the beginning of the `.Rprofile`:
```
options(error = renv:::renv_error_handler_call()); options(warn = 2L); "
```
Then the error looks like this (no change, it seems):
```
$ R -e 'bookdown::render_book( "index.Rmd", "bookdown::gitbook", output_dir = "public" )'
R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (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.
- Project '/builds/PMDA/training/the_book_of_flowers' loaded. [renv 1.0.2]
Error in if (grepl("-display$", label)) return(TRUE) :
(converted from warning) the condition has length > 1
Calls: source ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
> bookdown::render_book( "index.Rmd", "bookdown::gitbook", output_dir = "public" )
Error in if (grepl("-display$", label)) return(TRUE) :
(converted from warning) the condition has length > 1
Calls: source ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
```
Thanks! Can you please offer advice where I can locate my renv cache directory? I am using a PC. I do not see a folder for ".renv", only "renv". Is it the folder within the renv folder where all the libraries are located?
Should I be using a .renvignore instead?
cderv
October 31, 2023, 12:37am
4
Look at the documentation about paths maybe ?
By default, renv stores global state in the following OS-specific folders:
PlatformLocation
Linux~/.cache/R/renv
macOS~/Library/Caches/org.R-project.R/R/renv
Windows%LOCALAPPDATA%/R/cache/R/renv
If desired, this path can be customized by setting...
This will allow you to get the effective value for your project.
system
Closed
November 21, 2023, 12:37am
5
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.