-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path2-setup.Rmd
51 lines (37 loc) · 1.54 KB
/
2-setup.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
---
title: "2-setup"
author: "D-Lab"
date: "3/7/2019"
output: html_document
---
If you wish to follow along, make sure you have:
1. Downloaded R: https://cloud.r-project.org/
2. Downloaded RStudio Desktop (Open Source License FREE): https://www.rstudio.com/products/rstudio/download/
3. Downloaded these workshop materials: https://github.com/dlab-berkeley/RStudio-Project-Management
Once your RStudio environment is setup, run the below code manually to ensure that you have the necessary packages installed if you wish to follow along and/or use RStudio to manage your own projects.
> NOTE: this is still under construction and might or might not work for you during this pilot workshop...
```{r}
# List of packages we will use.
packages = c(
# data importation
"data.table",
# visualization
"ggplot2", "cowplot",
# summary statistics
"psych",
# for document preparation
"rmarkdown", "knitr"
)
# Try to load each package and save the result.
success = sapply(packages, require, character.only = T, quietly = T)
# Check if any packages still need to be installed.
if (sum(!success) > 0) {
# Install any needed packages.
install.packages(packages[!success])
# Load the newly installed packages.
sapply(packages[!success], require, character.only = T, quietly = T)
}
# Clean up variables.
rm(packages, success)
```
This install code [borrowed from this](https://github.com/dlab-berkeley/MachineLearningWG/blob/master/Spring2017/Apr14-svm/r-svm.Rmd) Machine Learning Working Group session on support vector machines.