-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathset-up.Rmd
More file actions
50 lines (39 loc) · 1.04 KB
/
Copy pathset-up.Rmd
File metadata and controls
50 lines (39 loc) · 1.04 KB
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
---
title: "set-up"
author: "Matt Nolan"
date: "14/10/2018"
output: html_document
---
```{r, include=FALSE}
#install.packages(c("tidyverse", "ggthemes", "optimx",lme4", "MuMIn", "cowplot", "GGally", "kableExtra", "lmertest", "merTools", "car", "corpcor", "merTools"))
knitr::opts_chunk$set(echo = TRUE)
```
# R Markdown {-}
Load packages needed by other scripts.
```{r cars}
library(tidyverse)
library(ggthemes)
library(optimx)
library(lme4)
library(MuMIn)
library(cowplot)
library(GGally)
```
Set parameter variables.
```{r}
# Save tables as jpegs. Set as 1 to do this.
# Code will take a lot longer to run.
stajpeg <- 0
```
Function for quick setup. Use this to avoid manually running these scripts. Note, source'd code is evaluated in the global environment by default, so results are available to work with.
```{r}
ksource <- function(x, ...) {
library(knitr)
source(purl(x, output = tempfile()), ...)
}
quick_setup <- function() {
ksource("Functions.Rmd", echo = TRUE)
ksource("LoadData.Rmd")
ksource("Props_mixed_model.Rmd")
}
```