My RStudio project consists of 2 small files:
".Rprofile":
Sys.setlocale(locale = "Lithuanian")
and "index.Rmd":
---
title: "„R“"
---
# ...
`r icon::fa("external-link-alt")`
When I start RStudio project, the error message appears in the console:
Error in yaml::yaml.load(string, ...) :
Reader error: control characters are not allowed: #9C at 21
When I push "Knit" button, it results in an error:
processing file: index.Rmd
Quitting from lines 2-7 (index.Rmd)
Error in yaml::yaml.load(string, ...) :
Reader error: control characters are not allowed: #9C at 21
Calls: <Anonymous> ... parse_yaml_front_matter -> yaml_load_utf8 -> <Anonymous>
Execution halted
Three components play here:
Lithuanian locale,
„“ symbols and
icon::fa("external-link-alt").
If any of them is not present, the problem disappears.
Question. Which package is the primary cause of the issue: yaml, icon or the problem is elsewhere? And how should the problem be fixed so that all three components could be used?
Shortened version if the session info:
Session info -----------------------------------
setting value
version R version 3.5.1 (2018-07-02)
system x86_64, mingw32
ui RStudio (1.1.456)
language (EN)
collate Lithuanian_Lithuania.1257
tz Europe/Helsinki
date 2018-08-20
Packages -----------------------------------
package * version date source
base * 3.5.1 2018-07-02 local
bookdown 0.7.17 2018-08-20 Github (rstudio/bookdown#4f9d73d)
icon * 0.1.0 2018-06-28 Github (ropenscilabs/icon#993fc64)
yaml 2.2.0 2018-07-25 CRAN (R 3.5.1)
UPDATE. The question was updated to reflect the problem more specifically:
bookdown
yaml
icon
other
Related
I am unable to install a package from GitHub. SCCRWP/ASCI. This is a model for assessing stream health using algal community composition. First my session info:
- Session info ------------------------------------------------------------------------------
setting value
version R version 4.1.3 (2022-03-10)
os Windows 10 x64 (build 19044)
system x86_64, mingw32
ui RStudio
language (EN)
collate English_United States.1252
ctype English_United States.1252
tz America/Los_Angeles
date 2022-06-28
rstudio 2022.02.3+492 Prairie Trillium (desktop)
pandoc NA
I will run the following:
library(devtools)
curl::ie_proxy_info()
install_github('SCCWRP/ASCI')
I have to run curl: whenever I use an API or github due to work's system settings. I get the following error message.
Downloading GitHub repo SCCWRP/ASCI#HEAD
SCCWRP-ASCI-82bd614/mmilkup.RData: truncated gzip input
tar.exe: Error exit delayed from previous errors.
Error: Failed to install 'ASCI' from GitHub:
Does not appear to be an R package (no DESCRIPTION)
In addition: Warning messages:
1: In utils::untar(tarfile, ...) :
‘tar.exe -xf "C:\Users\nmack\AppData\Local\Temp\RtmpOcZ5L9\file53d87e726d5b.tar.gz" -C "C:/Users/nmack/AppData/Local/Temp/RtmpOcZ5L9/remotes53d8228135e9"’ returned error code 1
2: In system(cmd, intern = TRUE) :
running command 'tar.exe -tf "C:\Users\nmack\AppData\Local\Temp\RtmpOcZ5L9\file53d87e726d5b.tar.gz"' had status 1
I contacted the package's author and was advised to download the repo and install locally. I received an error when installing locally stating that a dependency was missing. Upon installing the missing dependency I was successful => open the .Rproj file => hitting 'ctrl+shft+b'. The problem did not lie in the missing dependency since I am still unable to install with install_github('SCCWRP/ASCI'). The same error above returns. The author above(do not know his SOF handle) gave me two links of similar issues.
NOAA/VAST and SOF. From reading the resolution in one case it would seem a reduced DESCRIPTION would be a solution. The author replied, "I reduced the Description line in the DESCRIPTION file in the ASCI package to one line, so it would be interesting to see if you get the same error again", but I am getting the same error.
Not sure if this matters, but I can not seem to install from a .zip either. When I run:
install.packages("C:/Users/nmack/Downloads/ASCI-master.zip", repos = NULL, type = "win.binary")
I get a quick flash, no error message/notice and no package installed.
I am running a new install of R (3.5.0) and RStudio (1.1.414). [Note I have now updated to 3.5.1 and 1.1.453 and am still experiencing the issues below with the exception of the "built under R version 3.5.1" warning messages]
I have installed the rlang package using install.packages("rlang") without encountering any issues but when I attempt to load the package I get the following error
Error: package or namespace load failed for ‘rlang’:
.onLoad failed in loadNamespace() for 'rlang', details:
call: dots_list(...)
error: object 'rlang_dots_list' not found
In addition: Warning message:
package ‘rlang’ was built under R version 3.5.1
I've uninstalled and reinstalled rlang (closing restarting RStudio in between each command) and am still encountering this error.
I am also encountering a set of similar (although possible totally unrelated) issue with other packages
RStudio provides the following warning every startup
[Workspace loaded from ~/.RData]
Error in yaml.load(readLines(con), error.label = error.label, ...) :
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) :
object 'C_unserialize_from_yaml' not found
library(devtools) gives the following errors
Error: package or namespace load failed for ‘devtools’ in FUN(X[[i]], ...):
no such symbol digest in package //[redacted]/My
Documents/R/win-library/3.5/digest/libs/x64/digest.dll
In addition: Warning message:
package ‘devtools’ was built under R version 3.5.1
Someone on twitter asked for the results of packageDescription("rlang")
I've copied the output below in case it helps with troubleshooting.
Package: rlang
Version: 0.2.1
Title: Functions for Base Types and Core R and 'Tidyverse' Features
Description: A toolbox for working with base types, core R features like the condition system, and core
'Tidyverse' features like tidy evaluation.
Authors#R: c( person("Lionel", "Henry", ,"lionel#rstudio.com", c("aut", "cre")), person("Hadley", "Wickham",
,"hadley#rstudio.com", "aut"), person("RStudio", role = "cph") )
License: GPL-3
LazyData: true
ByteCompile: true
Depends: R (>= 3.1.0)
Suggests: crayon, knitr, methods, pillar, rmarkdown (>= 0.2.65), testthat, covr
RoxygenNote: 6.0.1
URL: http://rlang.tidyverse.org, https://github.com/r-lib/rlang
BugReports: https://github.com/r-lib/rlang/issues
NeedsCompilation: yes
Packaged: 2018-05-30 13:14:55 UTC; lionel
Author: Lionel Henry [aut, cre], Hadley Wickham [aut], RStudio [cph]
Maintainer: Lionel Henry <lionel#rstudio.com>
Repository: CRAN
Date/Publication: 2018-05-30 14:23:07 UTC
Built: R 3.5.1; x86_64-w64-mingw32; 2018-07-02 15:08:55 UTC; windows
-- File: [redacted]/My Documents/R/win-library/3.5/rlang/Meta/package.rds
You have 3 different warnings (digest, yaml, and rlang) that each indicate that a package DLL file is corrupted. You are doing something very wrong when installing your packages.
The most common cause of this problem is trying to update a package while it is loaded in R (possibly in another process!). It could also be caused by a bad antivirus program that locks the dll which prevents it from being updated. Please try the following steps:
Quit all R/Rstudio sessions. Check in taskmgr that no Rterm or Rgui process is running.
Delete the folders yaml, rlang and digest inside Documents\R\win-library\3.5\ and also inside C:\Program Files\R\R-3.5.x\library\ if they exists there as well.
Start R to confirm they are gone. Running library(yaml) or library(rlang) should give an error e.g: there is no package called ‘yaml’. Quit R.
Start a new R and run: install.packages(c("yaml", "rlang", "digest"))
Pay close attention to the output, especially the final lines. If you see a warning like below the installation got corrupted and you should remove the package!
Answering my own question in case anyone else encounters a similar issue in the future...
Working with my work IT department we have now tied this to custom permissions on my workstation that mean that R packages can only be run to pre-specified libraries (in my case "C:\R\R-3.4.3\library").
Installing packages directly into that location fixes the issue but is not desirable for all the reasons that people might want to use custom locations (e.g. running multiple versions of the same package, keeping separate libraries for some projects).
As such there are two solutions that may be more or less attainable given your own IT system.
Convince your IT department to relax the permissions for R packages
to allow custom library locations.
Give up and run everything from the "permitted" library location (e.g. C:\R\R-3.4.3\library)
Raise a support ticket every time you need to install a package into a custom location and hope that IT eventually gives in.
This sort of problems almost always comes from a bug in R on Windows: If you reinstall a package that includes compiled code, and if that package is already loaded in R, the DLL will not get updated.
Please try reinstalling rlang on a fresh session. Sometimes packages get loaded automatically at startup from .RProfile and you can check this by calling sessionInfo() after starting up.
I am developing a package and consider including a vignette in it. I use RStudio for my package development and followed the instructions from Hadley Wickam to use Rmarkdown and knitr or writing the vignette.
I am able to compile the vignette when pressing knit from Rstudio but the command devtools::check() returns an error:
==> devtools::check(cleanup = FALSE)
Updating mypackage documentation
Loading mypackage
Setting env vars ---------------------------------------------------------------
CFLAGS : -Wall -pedantic
CXXFLAGS :-Wall -pedantic
Building mypackage ---------------------------------------------------------------
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file
--no-environ \ --no-save --no-restore --quiet CMD build \ '/Volumes/Stockage/Dropbox/R/Packages/mypackage' --no-resave-data \
--no-manual
* checking for file ‘/Volumes/Stockage/Dropbox/R/Packages/mypackage/DESCRIPTION’ ... OK
* preparing ‘mypackage’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* installing the package to build vignettes
* creating vignettes ...
ERROR Error: processing vignette 'mypackage-vignette.Rmd' failed with diagnostics: It seems you should call rmarkdown::render() instead of knitr::knit2html() because mistral-vignette.Rmd appears to be an R Markdown v2 document.
Execution halted
Error: Command failed (1)
In addition: Warning message:
`cleanup` is deprecated
Execution halted
Exited with status 1.
What should I do or change ? I am aware it is only the check.
Session info:
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.6 (El Capitan)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggplot2_2.1.0 foreach_1.4.3 knitr_1.14 rmarkdown_1.2
[5] mistral_2.2.1
The error message below was misleading, and has been fixed in a later version of knitr:
ERROR Error: processing vignette 'mypackage-vignette.Rmd' failed with diagnostics: It seems you should call rmarkdown::render() instead of knitr::knit2html() because mistral-vignette.Rmd appears to be an R Markdown v2 document.
What went wrong was not the vignette engine knitr::rmarkdown. This vignette was correct. The problem was that you have to also add rmarkdown (in addition to knitr) to Suggests in your package's DESCRIPTION file, otherwise during R CMD check, the rmarkdown package won't be available, hence knitr will fall back to knit2html() to build the vignette, but knit2html() sees an Rmd document that is supposed to be compiled by rmarkdown::render(), so it threw an error.
The vignette engine knitr::rmarkdown depends on rmarkdown, so rmarkdown needs to be present in Suggests in DESCRIPTION. Similarly, if the vignette engine requires other packages, these packages have to be specified as (hard or soft) dependencies of the package being checked.
The original answer to this question mentioned the vignette engine rmarkdown::render. This is not a valid vignette engine, and should not be used.
Hi I am completely new to R markdown but everytime I try to knit and creat an html file it gives me this error
Error: 'opts_hooks' is not an exported object from 'namespace:knitr'
Execution halted
Can someone please help me? I have installed the knitr package but I don't know how to export opt_hooks.
I got the same issue, i guess this is an update of rmarkdown/rstudio button (didn't check) because this workaround works fine :
# to md
knit("myRmarkdown.Rmd")
# to html
knit2html("myRmarkdown.md")
Hope it helps.
PS: session info dump :
> devtools::session_info()
Session info ------------------------------------------------------------------------------------------------------------------------------
setting value
version R version 3.2.0 (2015-04-16)
system x86_64, linux-gnu
ui RStudio (0.99.902)
language (EN)
collate fr_FR.UTF-8
tz Europe/Paris
Packages ----------------------------------------------------------------------------------------------------------------------------------
package * version date source
devtools 1.8.0 2015-05-09 CRAN (R 3.2.0)
knitr * 1.11 2015-08-14 CRAN (R 3.2.0)
rmarkdown 0.9.6 2016-05-01 CRAN (R 3.2.0)
Recently my package on R-Forge failed to build on windows, not linux. Apparently packages kknn and trimTrees are not available. I cannot figure out why or why these two packages are different from randomForest or rgl which installs automatically. I have tried to include package names in description file in Depends-field and/or in Imports-field. Nothing works...
If installing my package from r-forge repos, with randomForest and trimTrees package removed, first mentioned will install automatically second will fail and have to be installed manually first. Why is this?
I have already read the this answer
thanks alot, Soren
description file:
Package: forestFloor
Type: Package
Title: forestFloor
Version: 1.4
Date: 2015-05-19
Author: Soeren Havelund Welling
Maintainer: Soeren Havelund Welling <SOWE#DTU.DK>
Depends: R (>= 3.0.0), randomForest, trimTrees, rgl, kknn
Suggests:
Description: Visualizes Random Forrest with feature contributions.
SystemRequirements: OpenGL, GLU Library, zlib
License: GPL-2
Imports: Rcpp (>= 0.11.3), randomForest, trimTrees, rgl, kknn
LinkingTo: Rcpp
namespace
useDynLib(forestFloor)
importFrom(Rcpp, evalCpp)
importFrom(randomForest, randomForest)
importFrom(trimTrees, cinbag)
import(rgl)
import(kknn)
S3method(plot,forestFloor)
S3method(print,forestFloor)
export(forestFloor,
plot.forestFloor,
print.forestFloor,
box.outliers,
recTree,
vec.plot,
convolute_ff,
convolute_ff2,
convolute_grid,
show3d_new,
fcol,
randomForest,
plot3d,
kknn,
persp3d)
-----------log file from r forge ----------
using log directory 'R:/run/building/build_2015-05-19-12-04/RF_PKG_CHECK/PKGS/forestFloor.Rcheck'
using R version 3.2.0 Patched (2015-05-16 r68378)
using platform: x86_64-w64-mingw32 (64-bit)
using session charset: ISO8859-1
using option '--as-cran'
checking for file 'forestFloor/DESCRIPTION' ... OK
checking extension type ... Package
this is package 'forestFloor' version '1.4'
checking CRAN incoming feasibility ... NOTE
Maintainer: 'Soeren Havelund Welling '
New submission
The Title field is just the package name: provide a real title.
* checking package namespace information ... OK
* checking package dependencies ... ERROR
No repository set, so cyclic dependency check skipped
Packages required but not available: 'trimTrees' 'kknn'
See section 'The DESCRIPTION file' in the 'Writing R Extensions'
manual.
* DONE
Status: 1 ERROR, 1 NOTE
See
'R:/run/building/build_2015-05-19-12-04/RF_PKG_CHECK/PKGS/forestFloor.Rcheck/00check.log'
for details.
Run time: 6.77 seconds.
It turned out to be a current rForge server issue when it updated to R 3.2. The problem can for now be fixed manually by contacting admin. They're working on general fix also.
link to bug tracker