year <- 2024
RR is an Interpreted LanguageR interpreter that translates your codeR involves functional programmingmean()dplyr::summarize()numeric objects (e.g., 2024, 21.2)
strings/character objects:
"Sam", "Male", "21")vector objects:
c("18", "23", "20"))data frames:
ages <- c("18", "23", "20")as.numeric(ages)ages <- as.numeric(ages)ages[1] 18 23 20mean(ageas.numeric(ages))[1] 20.33333RStudioR consoleR consoleRStudioBeyond the console
RStudioRR MarkdownR MarkdownMarkdown is a lightweight markup language used for adding formatting elements to plain text text
R Markdown is a markdown language create for R and RStudio
Allows you to dress up text, embed and render code, reference hyperlinks, etc. within a written document
Libraries like {rmarkdown} and {knitr} help you build HTML, pdf, and Word documents that update automatically with new data
R Markdown Filefods24my_first_markdown.Rmd/fods24R Markdown FileMy name is X and the year I start learning R is Y.
*
**
***
```{r}
```
Windows: CLTR+ALT+I
Mac: COMMAND+ALT+I
year ```{r}
year <- 2024
```
```{r}
band <- "your favorite band"
state <- "the state in which you grew up"
name <- "your name"
```
RRThe year is `r year`!
RThe year is `r year`!
The year is 2024!
R Markdown File# About me
## My favorite band
### My favorite band from the 1990s
[message](url)
[cheatsheet](https://gabrielcook.xyz/fods24/cheatsheets/rmarkdown-2.0.pdf)
R Markdown FilesHTMLpdfWordHTML file my_first_markdown.html