-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
66 lines (46 loc) · 3.79 KB
/
README.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
---
output: github_document
---
# Project template
![Last updated](https://img.shields.io/github/last-commit/uaappcomp/apcv302-project-template)
<!-- Only edit README.Rmd, never README.md! Knitting README.Rmd will produce README.md -->
Made by [Ryan Straight](https://github.com/ryanstraight) with [APCV 302](https://uaappcomp.github.io/apcv302/) in mind, specifically, as the focus is on using R for data analysis, this template is simple enough to fit most needs at the undergraduate level.
The actual report document being produced is an APA 6th edition document using the [`papaja`](https://github.com/crsh/papaja) package, and uses [`rfordatascience/tidytuesday`](https://github.com/rfordatascience/tidytuesday) code. You should also install `tinytex`, of course, as per the `papaja` instructions. Some demo code had been added to the script files and dummy text to the `draft.Rmd` to produce an example PDF. The `Bee Colony losses` dataset is loaded as an example. You'll notice heavy use of the `here` package, as well.
**Important**: each time you knit `draft.Rmd`, you will query GitHub. There is a limit on how often you can do this. Manually downloading the data into the `/data/raw` folder and loading from there will get around this.
An example of how to do this is to remove the `tidytuesdayR` data loading line from `munge.R`. Instead, simply run this in the console:
```r
download.file('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2022/2022-01-11/colony.csv', here("data", "raw", "colony.csv"))
```
Then, your data load in `munge.R` would be as such and you needn't worry about loading from GitHub:
`colony <- readr::read_csv(here("data", "raw", "colony.csv'))`
## Authors
1. Make your copy of the [contributor's template](https://docs.google.com/spreadsheets/d/1Gl0cwqN_nTsdFH9yhSvi9NypBfDCEhViGq4A3MnBrG8/copy) and complete as needed. Ensure your spreadsheet's permissions are set to `Anyone with the link can view`.
1. Place that URL in step 2 of the [tenzing](https://rollercoaster.shinyapps.io/tenzing/) Shiny app. (You can use [this spreadsheet](https://docs.google.com/spreadsheets/d/1-WmAfoW3HoHGfmeahcOrSTGxXwZpScUBajoHHrQ0Qy8/edit#gid=0) as a demonstration if you like.)
1. Choose `Show papaja YAML` in Step 3.
1. Replace the `author` and `affiliation` frontmatter in the `draft.Rmd` file with this new YAML.
## Report
The resultant report from this project is `/docs/draft.pdf` by default. The `papaja` document, `/docs/draft.Rmd`, has a variety of comments and instructions within as comments. These are general suggestions that follow a generic research paper structure.
## Folder and file structure
This is the default structure for a project. It's very basic and you should feel welcome to alter it to your liking.
```text
project-template/
├─ data/
│ ├─ raw/ # Store raw data here, if needed
│ ├─ tidy/ # Cleaned or altered data files go here
├─ docs/
│ ├─ draft.pdf # Knitted papaja PDF
│ ├─ draft.Rmd # papaja draft document
│ ├─ refs.bib # Put your references here in BibTeX format
│ ├─ r-references.bib# Packages used in document. Generated by papaja.
├─ media/ # Non-generated figures, images, media go here
├─ src/
│ ├─ eda.R # exploratory data analysis scripts
│ ├─ plots.R # Plots, figures, graphs, et cetera
│ ├─ munge.R # Any scripts used on raw data
├─ .gitignore # Keeps certain files from being seen by GitHub
├─ .Rbuildignore # List of files to be ignored by R building
├─ project.Rproj # R project file
├─ LICENSE.md # Identifies CC-BY license for project template
├─ README.Rmd # README RMarkdown file. Edit this file.
├─ README.md # ...not this one.
```