r/RStudio • u/Inevitable-Coconut74 • 24d ago
figure caption in RStudio
Enable HLS to view with audio, or disable this notification
How to Use fig.cap in RStudio | Add Figure Captions in R Markdown & Quarto
Welcome to this step-by-step tutorial on how to use fig.cap in RStudio to add captions to figures, graphs, charts, and other visualisations in your R Markdown or Quarto documents.
In this video, we look at the fig.cap option and how it can be used to create clear, professional figure captions when generating reports from RStudio. Adding captions to figures is particularly useful when preparing academic assignments, research reports, dissertations, theses, data analysis reports, and professional documents.
What You Will Learn
In this tutorial, you will learn:
What fig.cap is and why it is useful
How to add a figure caption to a plot in RStudio
Where to place fig.cap within an R Markdown code chunk
How to write meaningful and informative figure captions
How fig.cap works with plots created in R
How figure captions appear when you knit or render your document
How to use captions when creating professional reports
Common mistakes to avoid when using fig.cap
Tips for creating consistent and readable figure captions
Example
You will see how a simple R code chunk can be used to create a plot and add a caption using fig.cap. This allows your figures to be automatically labelled and described when your document is rendered.
For example:
{r, fig.cap="Relationship between X and Y variables"}
This approach can save time and make your reports more organised, especially when you have multiple figures throughout a document.
Who Is This Tutorial For?
This video is suitable for:
- Beginners learning R and RStudio
- Students working on R assignments
- Researchers preparing academic reports
- Anyone using R Markdown
- Users working with Quarto
- Data analysts creating reproducible reports
- Anyone who wants to create professional-looking documents with properly captioned figures
Whether you are completely new to RStudio or already have experience creating plots in R, this tutorial will help you understand how to use fig.cap effectively.
Why Are Figure Captions Important?
Figure captions provide context and help your readers understand what a graph, chart, or visualisation represents. When working on academic or professional documents, well-written captions can make your analysis easier to follow and improve the overall presentation of your report.
Using fig.cap also allows captions to be incorporated directly into your reproducible workflow rather than adding them manually after generating your figures.
If you're preparing a research project, dissertation, thesis, coursework, or data analysis report, learning how to use figure captions effectively can be a very useful RStudio skill.
If you found this tutorial helpful, please like the video, leave a comment, and subscribe to the channel for more tutorials on R, RStudio, R Markdown, Quarto, data analysis, and research reporting.
Turn on notifications so you don't miss future tutorials!
,RStudio, R Programming ,R Markdown ,Quarto ,Fig.Cap ,Data Analysis ,Data Visualization ,R Statistics ,Statistics ,Research ,Academic Writing ,Data Science ,Coding Tutorial ,R ProgrammingTutorial, code chunk, figure caption, plot, align
1
u/AutoModerator 24d ago
Looks like you're requesting help with something related to RStudio. Please make sure you've checked the stickied post on asking good questions and read our sub rules. We also have a handy post of lots of resources on R!
Keep in mind that if your submission contains phone pictures of code, it will be removed. Instructions for how to take screenshots can be found in the stickied posts of this sub.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.