-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsession-projects.qmd
129 lines (87 loc) · 4.11 KB
/
session-projects.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
---
title: "Introduction to R and Rstudio"
subtitle: "Session - Projects"
execute:
echo: false
---
```{r}
#| label: "libs"
#| include: false
#| eval: true
#| echo: false
library(countdown)
```
## Projects
<img src="img/session-projects/cracked_setwd.PNG" alt="Alison Horst's cartoons of three cubes, there is a setwd looking cross having broken an arm and a leg, the RProj with a skateboard and a small, concentrating purple cube with a helmet doing tricks on its skateboard" width="40%"/>
## Working Directory
If you tell R/R Studio to look for a file, or save a plot, it will (by default) look in a place called the working directory (wd)
<img src="img/session-projects/working-directory.PNG" alt="Screenshot of the tabs `Console/Terminal` and Jobs in RStudio and underneath the location of the workshop at ~" class="center"/>
## Change overall default Working Directory
Often defaults to the `Documents` folder but can be changed in `Tools/Global Options`
<img src="img/session-projects/change-wd.PNG" alt="Screenshot of the Tools/Global Options with the Default working directory box highlighted." class="center"/>
## Bookmarks
A Project can make it easier to find tell your session where to get files from and where to save them but, like bookmarks, you can:
::: incremental
- share this location with others
- move between projects easily
:::
## Project menu
::: columns
::: {.column width="50%"}
Step 1
</br> <img src="img/session-projects/project-list.PNG" alt="Screenshot of the specific project menu from the top right area of RStudio" class="center"/>
:::
::: {.column width="50%"}
Step 2
</br> <img src="img/session-projects/project-wizard.PNG" alt="Screenshot of the project wizard when new Project... selected" class="center"/>
:::
:::
::: notes
People on the cloud can't follow this currently but it's recommended to review this once on a computer.
For those who have set up their own computers this will be needed for the unzipped data folder that was downloaded in order to see the Files in the bottom pane.
:::
## Project Type and Name wizards
::: columns
::: {.column width="50%"}
Step 3
</br> <img src="img/session-projects/project-type.PNG" alt="Screenshot of the project type list starting with New Project but includes R Package and Shiny Application" class="center"/>
:::
::: {.column width="50%"}
Step 4
</br> <img src="img/session-projects/project-name.PNG" alt="Screenshot of the project name wizard where the location can also be changed" class="center"/>
:::
:::
::: notes
Show creating a new directory, for example Quarto website as all the template files are also created.
Then show create in an existing directory for the benefit of those working on their own computers.
Note how the name is derived from the folder.
:::
## Have a go! *Not for the RStudio Cloud*
1. Create a project in an existing folder using the Project menu.
2. Note the name of the `.Rproj` file that is generated automatically.
3. Create a new project, this time choosing the selection `Shiny Application`. What files are created?
4. Using the Project menu move between the two projects.
Extra: Delete one of the `.Rproj` files and then try to select it from the menu. What happens?
## Browsing in RStudio
::: columns
::: {.column width="40%"}
Click the three dot icon in the bottom right quadrant, Files tab:
:::
::: {.column width="50%"}
<img src="img/session-projects/wd-files.PNG" alt="A screenshot of the Files tab with the three dot button highlighted, the words Click to open and explorer type browser is on the image."/>
:::
:::
## Getting back to the working directory
::: columns
::: {.column width="50%"}
First way:
Click the grey arrow next to the file pathway `~/` in the Console
</br> <img src="img/session-projects/working-directory.PNG" alt="Screenshot of the working directory name and grey arrow found in the Console."/>
:::
::: {.column width="50%"}
Second way:
Once a project has been created an R hex logo appears in the Files tab next to the three dots
<img src="img/session-projects/r-link-wd.PNG" alt="A screenshot of the Files tab with the R hex icon next to the three dots highlighted."/>
:::
:::
## End session