unl_r_for_biologists_class_march_8_2017.md 3.13 KB
Newer Older
1
2
3
4
+++
title = "R for Biologists, March 8, 2017"
description = "R for Biologists, March 8, 2017."
+++
5
6
7
8
9
10
11
12
13
14
15
16

**We will be utilizing <span style="color: rgb(255,0,0);">red</span> and
<span style="color: rgb(51,153,102);">green</span> sticky notes today.
If you run into problems or have questions,**

**please place the <span style="color: rgb(255,0,0);">red</span> sticky
note to the back of your computer screen and a helper will assist you.**

 

If you have not already requested an HCC account under the rcourse998
group, please do so
joshcarini's avatar
joshcarini committed
17
[here](https://hcc.unl.edu/new-user-request)
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

If you already have an HCC account and need to be added to the
rcourse998 group, please let us know.

If you have not previously set up Duo Authentication, please ask for
assistance.

 

**Set up Instructions:**

**Windows:**

For Windows will we use two third party
application **PuTTY** and **WinSCP** for demonstration.

PuTTY:  
joshcarini's avatar
joshcarini committed
35
&lt;[http://www.putty.org/](http://www.putty.org/)&gt;
36
37

WinSCP:
joshcarini's avatar
joshcarini committed
38
&lt; [http://winscp.net/eng/download.php](http://winscp.net/eng/download.php)&gt;
39
40
41
42
43

**Mac/Linux:**

Mac and Linux users will need to download and install **Cyberduck**.
Detailed information for downloading and setting up Cyberduck can be
44
found here: [For Mac/Linux Users](https://cyberduck.io/)
45
46
47

 

joshcarini's avatar
joshcarini committed
48
49
**Linux Commands Reference List:**

Adam Caprez's avatar
Adam Caprez committed
50
[https://hcc.unl.edu/docs/Quickstarts/connecting/basic_linux_commands/](https://hcc.unl.edu/docs/Quickstarts/connecting/basic_linux_commands/)  
joshcarini's avatar
joshcarini committed
51
52
53
54

 

  **R core and R Studio:**
55
56
57
58
59
60

We will be writing scripts offline in RStudio and then uploading them to
execute them on the cluster. This lesson assumes you have the R core and
RStudio installed. If you do not you can install them here:

R
joshcarini's avatar
joshcarini committed
61
core: [https://cloud.r-project.org/](https://cloud.r-project.org/)
62

joshcarini's avatar
joshcarini committed
63
RStudio: [https://www.rstudio.com/products/rstudio/download/](https://www.rstudio.com/products/rstudio/download/)
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82

 

**Required Packages:**

We will also be using the dplyr, ggplot2 and maps package. If you do not
have these installed, please install them now. You can do so using the
following commands inside the RStudio console:

    install.packages("dplyr")

    install.packages("ggplot2")

    install.packages("maps")

 

**What is a cluster:**

joshcarini's avatar
joshcarini committed
83
![](/images/cluster_small.png)
84
85

(picture courtesy
joshcarini's avatar
joshcarini committed
86
of: [http://training.h3abionet.org/technical_workshop_2015/?page_id=403](http://training.h3abionet.org/technical_workshop_2015/?page_id=403))
87
88
89
90
91
92
93
94
95
96
97
98
99

### To download the tutorial files:

-   Navigate to your $WORK directory: 
    -   cd $WORK

-   Clone the github repo containing the tutorial files:
    -   git clone https://github.com/unlhcc/HCCWorkshops.git

 

Take Home Exercise:

100
[Data Analysis in R](https://unl.box.com/s/8i647f8are21tc11la0jqk2xddlg19wy) - Please note
101
102
103
104
105
106
107
108
109
110
111
112
113
that the on the bottom of page three, there is a missing parenthesis at
the end of the last command.

The final code chunk should read:

    # Calculate flight age using birthmonth

    age <- data.frame(names(acStart), acStart, stringsAsFactors=FALSE)

    colnames(age) <- c("TailNum", "acStart")

    flights <- left_join(flights, age, by="TailNum")

114
    flights <- mutate(flights, Age = (flights$Year * 12) + flights$Month - flights$acStart)