Quarto Render not Rendering - r

I am trying out Quarto, I am using R version 4.2.1. When I go to RStudio, File -> New File -> Quarto Document and create a new document, when I try to render via the RStudio Render button, I get the error 'C:/Program' is not recognized as an internal or external command, operable progam or batch file
I have tried installing R in a directory which has no white space in the installation path, but this did not resolve the issue.
UPDATE: on doing quarto check as suggested in comment gave me
Not sure what that means, but I was able to solve the problem by ensuring my qmd quarto file did not have white space in its name (replaced white space with underscores. The error then went away.

On changing my qmd file name, from HVL campaign.qmd to HVL_campaign.qmd (removing the white space), the rendering works. The error message was misleading though, that may need to get looked at...?

This error pops up if there is a space anywhere in the filepath unfortunately. I am running into this error when I try to make a new project in a directory that has a filepath with a space (thanks onderive...)

Related

Link chrome to Rstudio for pagedown (Rmarkdown)

I want to convert my html document, created on Rmarkdown to pdf.
One of the way is to use the pagedown package.
However, when I add:
knit: pagedown::chrome_print
in the yaml header, I get the error:
Error in find_chrome() : Cannot find Google Chrome or Edge automatically from the Windows Registry Hive.
Please pass the full path of chrome.exe or msedge.exe to the 'browser' argument
or to the environment variable 'PAGEDOWN_CHROME'.
However, i have no idea on how to link the Chrome browser to rstudio, or where can I access to 'PAGEDOWN_CHROME'.
I tried:
knit: pagedown::chrome_print(browser="C:/Users/johndoe/AppData/Roaming/Microsoft/Windows/Start Menu/Programs"
which is the path to Chrome but the knitting systematically hangs without giving an error.
I am sure this is an easy procedure but but I'm a beginner at this stuff.
I've done a lot of research on SO and the internet, but obviously everyone knows how to do it !
Thanks :-)

How to insert image on Jupyter Notebook

I am using macOS and trying to add an image (png) file on Jupyter Notebook markdown cell, but it keeps generating an error message that they cannot find the png file. I am not sure what is wrong with my following two codes:
![alt text]("~Users/jj/pythonworkspace/what.is.numpy.png" "What is Numpy?")
Alternatively,
<img src="~Users/jj/pythonworkspace/what.is.numpy.png">
You shouldn't be using quotations around your path or links. Also i think you meant to have an additional / after your home directory or maybe not have ~ at all. The path you're providing isn't following the macOS conventions.
You can test if that path is valid by going into terminal and running
ls /path/you/are/testing
try
![What is Numpy?](/Users/jj/pythonworkspace/what.is.numpy.png)

rmarkdown::render_site() Error in rmarkdown::render_site() : No site generator found

I am trying to knit together 3 files using this example: http://rmarkdown.rstudio.com/rmarkdown_websites.html
My files all share the same directory, which has been set in the RStudio build options. I literally copied the YML from the examples with my own file names. Even if I copy the examples directly, I get the same error.
I even ran the site_generator function from the RMarkdown Github: https://github.com/rstudio/rmarkdown/blob/master/R/render_site.R#L157
I noticed there are options for custom generators, which I do not want. All I would like to do is be able to knit together several markdown files into a single webpage and then create a navbar with tabs for each page/section.
I got the same error when attempting to build with an incorrectly named YAML config file. Specifically, the RStudio build option for a website requires that the config file be called _site.yml.
Verify that this file exists and that you're using the extension .yml rather than .yaml (even though the latter is preferred).
What helped for me was putting the line site: bookdown::bookdown_site back to index.Rmd.
lord, my issue was that i didn't set my working directly to where my _site.yml file and index.Rmd files are stored - the little things!
I fixed this error using this steps.
1-) RStudio-Tools-InstallPackages
2-) Install From should be CRAN Repository.
3-) write this command --> install.packages("install.packages("rmarkdown")")
4-) Click Install
And problem has gone... And this is output.
This error also appears when there is a format issue in the yaml section of index.Rmd.
In my case, I encountered the error when the opening "---" in index.Rmd had a couple of white spaces " ---".
If you are having this problem, I would recommend knitting index.Rmd by itself (not building the book) before trying anything more drastic.

Issue with .Rprofile file when trying to upload to RPubs

From what I can gather there is a well documented issue with uploading Rpubs to RStudio. The solution is to create a .Rprofile and with an additional line:
options(rpubs.upload.method = "internal")
and then put the .Rprofile file in your working directory, and restart the program. My issue is that when I attempt this and start up RStudio I am presented with the error:
Error in assign(".popath", popath, .BaseNamespaceEnv) :
cannot change value of locked binding for '.popath'
Can anyone suggest what I may be doing wrong? What have I missed?
The solution is provided by a careful rereading of http://rstudio-pubs-static.s3.amazonaws.com/25030_8e9c9ffc3b3c423d9381d81543423502.html
"Put in options(rpubs.upload.method = “internal”) and no other text at all". Meaning that this line of code is the only code present in the .Rprofile file.
Previously I had been adding the line to a copy of the rest of the Rprofile text. The unnecessary code was the culprit.

How to solve this error message in rmarkdown?

I am just starting to explore the rmarkdown package. I don't use Rstudio. I use the default R environment. What I did was as follows.
I created a new R document.
Started typing few lines in rmarkdown format.
Saved the file with Rmd extension.
I saved the file in the working directory.
I installed the pandoc using the pkg file.
I installed 'rmarkdown' package. Loaded the package.
Used the following command to render the Rmd file.
rmarkdown::render("Untitled.Rmd")
I get the following error.
Error in tools::file_path_as_absolute(input) : file 'Untitled.Rmd'
does not exist
I tried all the possible ways such as giving the exact path instead of filename etc. But nothing worked out. I googled the error message and found that none had similar error. Can someone help me with this. What I am missing. What the error message mean?
Most of the time the error file not found is either a type error or a real missing file (as in your case, the real one is named in another way).
In order to discard those possibilities:
Copy the fullpath from your filebrowser.
Make sure the file exists, inside R you could type:
file.exists("/fullpath/to/file")
If that return TRUE and the error persists, then you suspect another thing is going on.

Resources