Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
365 views
in Technique[技术] by (71.8m points)

r - object 'C_stri_join' not found - Using knitr in Rstudio

When using the knit button in Rstudio I get an error object 'C_stri_join' not found.

Here is an example:

---
title: "Sample Document"
output:
   html_document:
   toc: true
   theme: united
---

<!--
%VignetteEngine{knitr::knitr}
%VignetteIndexEntry{Basic test}
-->

Here we go

```{r}
x <- 1

str(x)
```

The error is as follows:

Error in stri_c(..., sep = sep, collapse = collapse, ignore_null = TRUE) : 
  object 'C_stri_join' not found
Calls: suppressPackageStartupMessages ... evaluate_call -> handle_output -> <Anonymous> -> str_c -> stri_c

This comes after a recent update of my R packages:

> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United Kingdom.1252 
[2] LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

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

loaded via a namespace (and not attached):
[1] htmltools_0.2.6 tools_3.2.2     yaml_2.1.13     rmarkdown_0.8.1
[5] digest_0.6.8   

The error seems to originate from the call to str in the R code chunk since the following works without error:

---
title: "Sample Document"
output:
  html_document:
    toc: true
    theme: united
---

<!--
%VignetteEngine{knitr::knitr}
%VignetteIndexEntry{Basic test}
-->

Here we go

```{r}
x <- 1

# str(x)
```

This is similar to this issue but little details are given there.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This was fixed by simply re-installing the stringi package.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...