CHU0397 | National Taiwan Normal University
1. Create the file ๐
Go to New File > R Markdown. This moves you from raw code to a โlivingโ document.
2. Configure (YAML) โ๏ธ
The header between --- controls your title, author, and output format (HTML/PDF).
3. Text + Code chunks ๐
Write text normally; insert Code Chunks ({r}) for analysis.
4. Run your codes โถ๏ธ
Use the green Play Button to test individual steps.
5. The final โKnitโ ๐งถ
Click Knit to stitch everything into a polished report automatically!
::: {.column width = โ45%โ} ::: {.r-stack} 



:::
:::
When you try to knit your R Markdown document into a PDF file, you may encounter this message:
sh: pdflatex: command not found
Error: LaTeX failed to compile Untitled.tex. See The R package tinytex - Helper Functions to Manage TinyTeX, and Compile LaTeX Documents - Yihui Xie | ่ฐข็่พ for debugging tips. See Untitled.log for more info.
In addition: Warning message:
In system2(..., stdout = if (use_file_stdout()) f1 else FALSE, stderr = f2) :
error in running command
Execution haltedYou need to install a package before creating the PDF document.
Here are the steps:
1. Run this line of code in the console block:
It can take some time, up to 5 minutes.
2. Click one more time on โKnit to PDFโ
Itโs supposed to work. If it still doesnโt work, please contact me!
You can find more about how to write R Markdown documents on this website:
Task list:
๐ Assignment for next week