-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathorganisation.Rmd
72 lines (60 loc) · 2.31 KB
/
organisation.Rmd
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
```{r, echo=FALSE}
# adjust and load as needed
source(file = "setup.R")
```
# Organisation
## Objectives
:::objectives
* Consider ways to organise and structure your data and analysis
:::
## Exercise: tidy forensic science
:::exercise
Use the data from the [forensic science exercise](#forensic-science) to create a folder structure and file naming convention that tidies everything up.
<details><summary>Answer</summary>
A possible directory and file structure could look as follows:
```
forensic-science
|_ `forensic-science.Rproj`
|_ data
|__ raw
|__ `2011-12-01_gapminder_data.xlsx`
|__ processed
|__ `subset-gapminder_worldregion_oceania.csv`
|__ `subset-gapminder_yr1982.csv`
|__ `subset-gapminder_country_canada.csv`
|_ scripts
|__ `fs-lifeyear_canada.R`
|__ `fs-lifeyear_oceania.R`
|__ `fs-lifeyear_yr1982.R`
|__ `fs-figures.R`
|_ output
|__ documents
|__ `manuscript-figure_captions.docx`
|__ exploration
|__ `fs-lifeyear_canada_1950to2000.png`
|__ `fs-lifeyear_canada_2000to2002.png`
|__ `fs-lifeyear_netherlands_1950to2010.png`
|__ figures
|__ `fs-lifeyear_canada_1950to2010.png`
|__ `fs-lifeyear_oceania_1950to2010.png`
|__ `fs-lifeyear_world_1982.png`
|_ misc
|__ `data-original_from_matthew.xlsx`
```
</details>
:::
## Exercise: Me, me, me!
::: exercise
Now that you've thought about structuring the mess I left you with in the `forensic_science` folder, it's time to put your new, obsessively organised self to work on your own project(s).
I'd like you to take one of your projects (preferably the one you're still storing only on your Desktop...) and make a copy of it.
Using the copy, I want you to reorganise your files into a coherent directory structure. Once you've done that, I need you to have a good look at the filenames. Are they clear? Are they providing information of what's contained in the file? Do the files sort logically?
:::
## Key points
:::keypoints
* Whatever system you use, make sure you have one!
* Store files in a logical directory structure
* Have a `misc`/`stuff` folder to store random stuff in
* Name your files so they give you information on what they contain
* Make sure files sort properly by tweaking your file names
* Be consistent, stick to the system you've chosen!
:::