Converting from *.docx using redoc::dedoc corrupt - r

I have created a word file from an rmarkdown file using redoc output directly in RStudio and clicking "knit". This works fine.
---
title: "Untitled"
output:
redoc::redoc
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## GitHub Documents
This is an R Markdown format used for publishing markdown documents to GitHub. When you click the **Knit** button all R code chunks are run and a markdown file (.md) suitable for publishing to GitHub is generated.
## Including Code
You can include R code in the document as follows:
```{r cars}
summary(cars)
```
but trying to convert it back to Rmd it throws an error. Has anyone else had that?
redoc::dedoc(docx = "test.docx",overwrite = TRUE)
Error in convert_docx_to_md(docx, track_changes, wrap, verbose, md_only) :
lazy-load database '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rmarkdown/R/rmarkdown.rdb' is corrupt
In addition: Warning messages:
1: In convert_docx_to_md(docx, track_changes, wrap, verbose, md_only) :
restarting interrupted promise evaluation
2: In convert_docx_to_md(docx, track_changes, wrap, verbose, md_only) :
internal error -3 in R_decompress1

Related

Erro R "Error: '\U' used without hex digits in character string starting ""C:\U"

When starting RStudio, this error appears. I can run several commands, but I can't compile anything in Rmarkdown. Does anyone know how I can fix it?
The error does not appear when typing a path to read from the file. It even appears when I try to compile an empty file in RMarkdown.
The error even appears with the default example script in RMarkdown.
---
title: "Untitled"
author: "Autor"
output: pdf_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r cars}
summary(cars)
```
## Including Plots
You can also embed plots, for example:
```{r pressure, echo=FALSE}
plot(pressure)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.

Execution halted when knitting in RStudio

I´m new at R. I was trying to knit a Rmd file in RStudio into a pdf, but it presents the following error:
Quitting from lines 17-20 (projeto_final_20220429.Rmd)
Error in .External2(C_dataviewer, x, title) : unable to start data viewer
Calls: ... withCallingHandlers -> withVisible -> eval -> eval -> View
Execution halted
The code written in those lines was this:
library(readr)
despesas_municipios_saude_educacao <- read_csv("despesas_municipios_saude_educacao.csv")
View (despesas_municipios_saude_educacao)
Is there anyone who can help me?
On MacOS, knitr attempts to load the X11 library in order to view the data frame, which fails because knitr isn't designed to interact with an end user. Regardless of the underlying operating system, since utils::View() is meant to work in a windowing environment (e.g. RStudio, RGui, R Tools for Visual Studio, etc.), it can't be used to print a data frame in an R Markdown document.
---
title: "Error with View()"
output: html_document
date: "`r Sys.Date()`"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## A header
Here is a reproducible version of the stackoverflow question [Execution Halted when Knitting](https://stackoverflow.com/questions/72068679/execution-halted-when-knitting-in-rstudio).
```{r mtcars}
data(mtcars)
View(mtcars)
```
...generates the following error:
To display a subset of data in a markdown file, one can use head() instead of View().
---
title: "Error with View()"
output: html_document
date: "`r Sys.Date()`"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## A header
Here is a reproducible version of the stackoverflow question [Execution Halted when Knitting](https://stackoverflow.com/questions/72068679/execution-halted-when-knitting-in-rstudio).
```{r mtcars}
data(mtcars)
head(mtcars)
```
...and the output in HTML:
We can improve the look of the output by turning off echo on the R chunk used to print the table, and use knitr:kable() to format the data frame.
We use the following R Markdown code, including the "pipe" argument to appropriately space the columns in the output.
We can make the output look nicer with `knitr::kable()`.
```{r kableVersion,echo=FALSE}
library(kableExtra)
kable(head(mtcars),"pipe")
```
...and the output renders like this in HTML:

R Markdown will not knit at all

My Rmarkdowns will no longer knit, every file give the same error.
Under the Render window, it says:
Error in library(emo) : there is no package called ‘emo’
Execution halted
However, I have never used a package called emo and that package is certainly not in this empty .Rmd file
I've tried updating R and RStudio, I'm just quite lost. Any guidance would help!
Here is my code, I haven't changed a single thing after opening the new .Rmd. has
---
title: "knitting_test"
author: "XXXXX"
date: "1/20/2022"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r cars}
summary(cars)
```

Knit error in RStudio: pandoc conversion failed with error 23. Extension ascii_identifiers is not supported for markdown

Trying to knit a doc into html, RStudio would hang on the conversion to html part. I looked around and it looked like this happened to other folks when they were using an out of date pandoc version. I updated pandoc to 2.8. I received the error in the title. Looking around again, it appeared that v 2.5 seemed stable. I installed that, restarted my computer, and still get the same error.
repex is the default example when you create an RMarkdown file in RStudio: file -> New file -> R Markdown -> html.
---
title: "repexpandocerror23"
author: "Adam Korejwa"
date: "11/22/2019"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for
authoring HTML, PDF, and MS Word documents. For more details on using R
Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that
includes both content as well as the output of any embedded R code chunks
within the document. You can embed an R code chunk like this:
```{r cars}
summary(cars)
```
## Including Plots
You can also embed plots, for example:
```{r pressure, echo=FALSE}
plot(pressure)
```
Note that the `echo = FALSE` parameter was added to the code chunk to
prevent printing of the R code that generated the plot.
I have fixed this issue two months ago. Please make sure your rmarkdown version is at least v1.16. Once again, when in doubt, consider updating your packages:
update.packages(ask = FALSE, checkBuilt = TRUE)

Rmarkdown - How to see the warnings when knitting

So I am creating a html document with html_document in the yalm header with Rmarkdown. I push "knit" in Rstudio and the document gets created, but I get the following message at the end (in the Rmarkdown tab next to the Console and Terminal tabs):
Output created: version2_rapport.html
There were 14 warnings (use warnings() to see them)
But I don't know how to see the warnings... Where and how should I use warnings()? I have tried to type warnings() in the console but nothing happens.
My setup chunk is:
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE)
```
I don't want messages in my output and I just want to see them i.e. they should not be included in my html file with my graphs etc.

Resources