Statistical Methods with R
Unit A · Chapter 02 · Lecture 02a
Developed by Jeffrey M. Girard
Projects
Quarto
Markdown
Activity
# Create a new Project
- Open the "File" menu in RStudio
- Select the "New Project..." option
- Select the "New Directory" option
- Select the "New Project" option
- Name the directory "PSYC 399" or "PSYC 800" (or whatever)
- Browse to where to create your Project folder
# Create a new File
- Explore the Files tab in the Extras pane
- Create a New File (e.g., a script) as an example
- RStudio will automatically create it in your project folder
- Add some text to the example file (e.g., "# Hello World")
- Save the file and note that it defaults to your project folder
- Close the script with the "x" icon
- Reopen the script from the Files tab
# Close and Open Project
- Open the "File" menu in RStudio
- Select the "Close Project" option
- Notice that your work is now gone
- Open the "File" menu in RStudio
- Select the "Open Project" option
- Browse to your project folder
- Open the .Rproj file (e.g., PSYC 399.Rproj)
- Notice that your work is now back!
# Create an Quarto Document
- Open the "File" menu in RStudio
- Select the "New File" option
- Select the "Quarto Document..." option
- Keep the defaults (HTML) and hit "Create Empty Document"
- Open the "File" menu
- Select the "Save" option
- Note that it defaults to the project folder
- Give it a name like "Lecture 02b" (or whatever)
- Note that the file extension is .qmd
# Add an R Chunk
- Option 1: Click the green box with C and a plus sign icon (top-right)
- Option 2: Ctrl+Alt+I (Win) or Cmd+Option+I (Mac)
- Option 3: Type out ```{r} then new line and ``` yourself
# Adding code to the chunk
- Anything you put inside the "fences" (i.e., ```) will be treated as R code
- The chunk operates like a mini console
- Try doing some calculations in the chunk and hit the green arrow
- The answer appears right below the chunk!
- If we save and render the document, it appears in the output too
- We can also add options to the chunk to control how it behaves
# Formatting
- *italics* and **bold** and ***italics and bold***
- superscript^2^ and subscript~2~
- ~~strikethrough~~
- `verbatim code`
# Headings
- # Header 1
- ## Header 2
- ### Header 3
# Links
- <https://quarto.org>
- [Quarto](https://quarto.org)
# Images
- 
# Lists
- * Unordered list
- + sub-item
- + sub-item
- 1. Ordered list
- 2. Item 2