简体   繁体   中英

Unable to render quarto in R

Am using a Windows with R version 4.2.0 (2022-04-22 ucrt) and RStudio 2022.07.1 but unable to render https://quarto.org/docs/get-started/hello/rstudio.html file. I get the error:

ERROR: Error executing 'reg': Access is denied. (os error 5)

Any leads?

If you get this error, it can indicate your Windows user profile doesn't give sufficient permissions.

To solve, close RStudio, and instead of opening RStudio the usual way, right click the RStudio icon, and click ' Run as Administrator ', then try again.

Works well for me using RStudio 2022.02.3 Build 492 and R version 4.0.4 (2021-02-15) on Windows 10.

在此处输入图像描述

EDIT: the real issue is now that it won't work if the Project/File is in a path that has any spaces in it. My organization installed OneDrive for everyone which changed our user paths from "C:\Users\First.LastName\Documents" to "C:\Users\First.LastName\OneDrive - Drive\Documents" Knit still works, but Render does not. My Solution is to use another directory such as "C:\R_Projects" to store my projects. However, these wont get automatically backed up to my OneDrive unless I do something to add them. I will not describe how to add them here.

I am leaving the following even though it doesn't seem as relevant any more: Running as Admin does work, but here must be a way to fix this without Admin privileges as that is a serious security risk. Thus far the answers don't indicate if you only have to run as admin once or if you always have to run as admin. My testing seems to indicate it is always.

The problem appears to be that something is blocking read of the source file for the render request. This occurs for R Markdown (Rmd) and Quarto (Qmd) rendering. I can still Knit rmd files. I think it is caused by one of two things:

1- the Visual Editor system may be locking the file such that readlines() cannot open it

2- the render process is trying to create a temp file in the "System Temp Directory" rather than the "user-space temp directory" Of course, there are other possibilities.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM