-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathset-up.Rmd
114 lines (72 loc) · 5.89 KB
/
set-up.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
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
---
title: "Set-up"
output:
html_document:
toc: true
include:
before_body: header.html
after_body: footer.html
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
The following will walk you through installing R, RStudio, and GitHub Desktop. Though the instructions are long, it hopefully will not take you long to get set up. You will need admin access on your laptop.
If you run into trouble, you can post in the comment section at the bottom. Please, help each other out in the comments if you can solve someone's installation issues. I will check in periodically and try to help too.
## Get an account on GitHub
If you don't already have an account on GitHub, go to [github.com](github.com) and click the "sign up" link near upper right
of the page. It is pretty self-explanatory. Go ahead and get a **free** account.
The free GitHub account does not have private repositories. Everything is public and viewable. You can upgrade (for money) and get private repositories. Or _if you are a student_, you can get private repositories from GitHub for free. Go to [https://education.github.com/pack](https://education.github.com/pack) to sign up for your free student pack. You will need to upload proof that you are a student or faculty.
## Install GitHub Desktop (Windows and Mac users)
*Windows users: GitHub Desktop is only available for 64-bit*
1. Go to [desktop.github.com](https://desktop.github.com/) and install.
2. Open GitHub Desktop, go to 'GitHub Desktop > Preferences' menu.
3. Under 'Accounts', sign into your GitHub account.
3. Under 'Git', enter your name (or initials) and the email you used for your GitHub account.
Linux users can install Git and interact with GitHub though RStudio. GitHub Desktop is not essential for the course, however it is a standard R Workflow that I will be demonstrating.
You should not need to install Git as that comes with GitHub Desktop, however it is possible that you will need to to interact with RStudio. If so, download and install Git from [git-scm](https://git-scm.com/downloads).
## Install R and RStudio
* **R:** Make sure you have the latest version of R.
Go to [https://cran.r-project.org/](https://cran.r-project.org/) and find the download link for your computer system.
* **RStudio:** Install the latest version of RStudio. Get it from [https://www.rstudio.com/products/rstudio/download](https://www.rstudio.com/products/rstudio/download) and install the appropriate one for your OS.
## Set up RStudio to use Git
1. Open RStudio
2. Go to Global Options (from the Tools menu)
3. Click Git/SVN
4. Click Enable version control interface for RStudio projects
Linux users will need to install Git for this to work.
Windows/Mac users: Git comes with GitHub Desktop. If RStudio complains that it cannot find Git: 1. Make sure you set your Preferences in GitHub Desktop. 2. Download and install Git from from [git-scm](https://git-scm.com/downloads).
## Install R packages
*If you get an error saying that the repository cannot be found: 1. Check that you are online. 2. Run `chooseCRANmirror()` and choose a mirror. 3. Repeat until you find a mirror that has the up to date packages.*
From the command line in R Studio
1. **bookdown:** package. Enter the following code at the command line (`>`).
```{r get-bd, eval=FALSE}
install.packages("devtools")
devtools::install_github("rstudio/bookdown")
```
2. Install **other packages** that we are going to be need. I have created a package on GitHub that will install the packages you need. This will probably take **awhile** as the first time you do it, many packages will be loaded.
```{r get-packages, eval=FALSE}
devtools::install_github("RVerse-Tutorials/RWorkflowsetup")
```
3. If you do not have LaTeX installed, you can install the tinytex package. Run these commands. This will allow you to make PDF files from R Markdown files.
```
install.packages('tinytex')
tinytex::install_tinytex()
```
## Create a workshop folder
Create a folder/directory on your computer for the workshop materials. You can create it anywhere you wish. Name it `RWorkflow` just so we all use the same folder name for the workshop.
## Disqus forum
I have added a Disqus forum to the website. [Create an account](https://disqus.com/) if you would like to be able to add comments/questions. This will allow people to pose questions to the group and allow me (and others) to answer.
## Downloading repositories
**In case we do not have internet access, I will provide the files on a thumb drive also.**
You will need to fork (copy) repositories from [RVerse-Tutorials](https://github.com/RVerse-Tutorials) for many of the labs. You can also download zip files.
1. Log into GitHub.
2. Go to [RVerse-Tutorials/Test](https://github.com/RVerse-Tutorials/Test).
3. Click 'Fork' in the upper right corner of the repository. This will create a copy of Test-Website in your GitHub account.
4. Open RStudio. Click File > New Project > Version Control
5. Paste in the url of the repository you are copying---the **forked** repository in your GitHub account. For example, `https://github.com/<youraccount>/Test` You can leave project name blank. Replace `<youraccount>` with your GitHub account.
6. You should now be able to see the files from Test in RStudio. There is only one file, `README.md`.
[Watch a video that shows you how to fork a repository](https://youtu.be/b6AaTHFIY7U)
## Packages with C++ code (Optional)
We will not be doing this in this short course, but often you will want to install packages with C++ code. To do that, you will need Rtools (Windows) or Xcode (Mac)
* **Rtools** Windows users [Rtools](https://cran.r-project.org/bin/windows/Rtools/) also so you can build packages with C++ code if needed. See comments here about changing path. [Rtools](http://stat545.com/packages01_system-prep.html#windows-system-prep)
* **Xcode** Mac users Open terminal and type the following command `xcode-select --install`