I am taking my first tentative steps with R-Notebooks and whatever I do, I get dozens of warnings:
In readChar(file, size, TRUE) : truncating string with embedded nuls
Initially I thought it was coming from source-ing a script, but now it seems to happen with almost any code block. I am not using readChar explicitly anywhere.
I also wondered if there was an incompatibility in the encoding of script files, but haven't been able to find a suitable setting to stop it (currently ISO8859-1), but frankly I am just guessing blindly.
Any idea what causes this and how I can stop them?
I am using R version 4.0.0 (2020-04-24) -- "Arbor Day"
It is possible that this only happens when Chunk Output Inline is set.
Too early to say for sure, but it has never shown these warnings when sending to the console.
I am curious if anyone else has experience of this.
Just wanna chime in and say that I've experienced the same issue after updating to R version 4.0.0. Using any other version of R solves the issue.
I get the error message you mention every time I try and use the kable() function to create an HTML table from a code chunk. The warnings disappear if i change the chunk option so that only the output is shown (echo = FALSE). In addition, the errors causes my R session to freeze, possibly due to high CPU usage.
Note that I cannot reproduce the problem outside my notebook but I'll try and see if I can make a reprex tomorrow.
I am guessing that this issue might be due to an incompatibility between the new R version and the knitr package?
Just checked the results for the template notebook and I can reproduce the problem there. If I create the notebook, hit the preview button and then run the code chunk I get 26 instances of the error message:
In readChar(file, size, TRUE) : truncating string with embedded nuls
So I can only reproduce the problem after previewing the notebook by running the code chunk. Note that the errors appear when I knit to PDF or any other format.
System Information:
RStudio Edition: Desktop
RStudio Version: 1.2.5042
OS Version: Windows 10 x64 (build 18363)
R Version: 4.0.0
Is there a way of at least suppressing the message that there are warnings in the viewer output?
Then I could just ignore it.
When I have chunk_output_type set to inline, it shows in the viewer
There were 50 or more warnings (use warnings() to see the first 50)
The chunk options include echo=FALSE, message=FALSE, warning=FALSE, error=FALSE, but it still messes up the output. If it isn't one of those, what is it?
I can recreate this too. For me it seems to require at least two chunks, one of which produces some output like a figure. Run all chunks then preview, and then running the first chunk produces this repeated set of warnings inline or in console that is variable in length each time.
platform x86_64-apple-darwin17.0
arch x86_64
os darwin17.0
system x86_64, darwin17.0
status
major 4
minor 0.0
year 2020
month 04
day 24
svn rev 78286
language R
version.string R version 4.0.0 (2020-04-24)
nickname Arbor Day
Do you also experience Rstudio crashing/freexing in larger notebooks or Rmarkdown documents? I have problems with this but can't recreate the problem in a simple example.