I am running create_report()
on a data frame, and R is returning an error message.
I have tried uninstalling rmarkdown
and reinstalling after opening R as an admin. I have also tried Ron's comment here which suggests doing the following below: Rmarkdown HTML Template produces pandoc error 61
file.edit("~/.Renviron")
and setting there a local path like this R_USER="C:/Users/my_name"
I ran this:
dbconnection <- odbcDriverConnect("Driver=SQL Server;Server=******;Database=*******;trusted_connection=yes")
initdata <- sqlQuery(dbconnection,paste("SELECT * FROM OPENQUERY(****,'SELECT fid****, fid****, fid**** FROM *************') WHERE fid**** = 'XXXXXXX' AND fid**** = 'XXXXXX';"))
odbcClose(dbconnection)
summary(initdata)
glimpse(initdata)
vis_miss(initdata)
vis_dat(initdata)
create_report(initdata)
And RStudio returns this:
Could not fetch http://?/UNC/******/FolderRedirection/user.name/Documents/R/win-library/3.6/rmarkdown/rmd/h/default.html
HttpExceptionRequest Request {
host = ""
port = 80
secure = False
requestHeaders = []
path = "/"
queryString = "?/UNC/******/FolderRedirection/user.name/Documents/R/win-library/3.6/rmarkdown/rmd/h/default.html"
method = "GET"
proxy = Nothing
rawBody = False
redirectCount = 10
responseTimeout = ResponseTimeoutDefault
requestVersion = HTTP/1.1
}
(InvalidDestinationHost "")
Quitting from lines 27-36 (test.Rmd)
Error: pandoc document conversion failed with error 61
Execution halted
I expect to be able to produce charts in an HTML document as described at the bottom of the following page:
This problem stems (at least in my case) from the fact that the used markdown library is a network folder (in your case "?/UNC/******/FolderRedirection/user.name/Documents/R/win-library/3.6/rmarkdown/rmd/h/default.html"). R cannot access this folder because rights are missing.
You have to change your default library to a place where you have full rights. For example "C:/Program Files/R/R-3.6.2/library".
In RStudio, click on Tools>Install Packages.. Under "Install to library" you can see the default option (in your case it should be "?/UNC/******/FolderRedirection/user.name/Documents/R/win-library/3.6/rmarkdown/rmd/h/default.html"). The second option here should be "C:/Program Files/R/R-3.6.2/library".
To change this order, ie to make the "C:/Program Files/R/R-3.6.2/library" folder the default folder, you have to use the following code (execute the code in a new R file) :
bothPaths <- .libPaths() # extract both paths
bothPaths <- c(bothPaths [2], bothPaths [1]) # change order
.libPaths(bothPaths ) # modify the order
After that, you might have to install the markdown package again. This time, it will be directly installed into the "C:/Program Files/R/R-3.6.2/library" folder.
Now, knitting should be working, because R will use the package straight from a folder where you have full rights.
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.