Reputation: 189
KableExtra functions do not work when I try to create a table in R Markdown (to html).
Here is the demo code that doesn't work in R Markdown:
iris %>%
slice_sample(n = 10) %>%
kbl() %>%
kable_styling()
The specific error message that shows up is:
Error in tempfile("_rs_html_deps_", tmpdir = ctx$outputFolder, fileext = ".json") :
temporary name too long
The error message shows up when the code is either run in R Markdown (to load the data from the global environment) or when the file is knitted. However, despite the same message showing up when the file is knitted, the table is in the knitted final html document and is correct.
Oddly, the code for the table works correctly when run in the console directly and no error message shows up.
Lastly, I can run this this chunk of code in R Markdown (not knitting) if the table is saved as an object.
test = iris %>%
slice_sample(n = 10) %>%
kbl() %>%
kable_styling()
However, when I then call test
, the same error message shows up:
Error in tempfile("_rs_html_deps_", tmpdir = ctx$outputFolder, fileext = ".json") : temporary name too long
Edit: Added YAML header information
Here is what I have in the YAML header
---
title: "Document"
author: "User"
date: "`Sys.Date()`"
output: html_document
---
Edit 2: The problem seems to have gone away after updating R Studio.
Edit 3: Sorry, the problem still persists. Any other ideas?
Upvotes: 1
Views: 2075
Reputation: 1
In short, the command line blogdown::built_site is one of the methods related to website rendering via bookdown.
Upvotes: 0
Reputation: 1
I have same problem here with kableExtra
version 1.3.4
Chunk code run properly in preview but not rendered in rmarkdown
for Hugo ink theme.
I strongly believe it is related to the version update. Cause I was able to render it with no problem.
I render it with
blogdown::build_site(build_rmd = T, local = T)
Upvotes: 0