-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathR_tips.html
More file actions
125 lines (111 loc) · 4.02 KB
/
R_tips.html
File metadata and controls
125 lines (111 loc) · 4.02 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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
<html>
<head>
<title>Stephanie Brink</title> <!--title of tab-->
<link rel="stylesheet" href="Style.css" type="text/css"/>
<link href='http://fonts.googleapis.com/css?family=Croissant+One' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Trykker' rel='stylesheet' type='text/css'>
</head>
<body>
<div id="top">
<h1 id="name">R Tips</h1>
<hr>
</div>
<br>
<div id="table">
<table>
<tr id="row">
<td>
<div id="research">
<p id="header">Table of Contents</p>
<ul>
<li><a href="R_tips.html#downloads">Downloads</a></li>
<li><a href="R_tips.html#nav">Navigation</a></li>
<li><a href="R_tips.html#dataframe">Data Frames</a></li>
<li><a href="R_tips.html#plots">Plots</a></li>
<li><a href="R_tips.html#standards">Code Standards</a></li>
<li><a href="R_tips.html#resources">Other Resources</a></li>
</ul>
<a name="downloads"><p id="header">Downloads</p></a>
<ul>
<li><a href="https://www.rstudio.com/products/rstudio/download/">RStudio</a></li>
<li><a href="https://cran.r-project.org/mirrors.html">R Package</a></li>
</ul>
<a name="nav"><p id="header">Naviation</p></a>
<ul>
<li>ls(): List known variables and functions definitions.</li>
<li>getwd(): Return current working directory.</li>
<li>setwd("path"): Change current working directory to
specified path enclosed by quotes.</li>
<li>?cmd: Access man pages for built-in R functions and
commands.</li>
</ul>
<a name="dataframes"><p id="header">Data Frames</p></a>
<ul>
<li><u>Create from file</u>:
<ul>
<li>read.table()</li>
<li>read.csv()</li>
</ul>
<li><u>Manipulate</u>:
<ul>
<li>Double vs Single Brackets</li>
<li>which()</li>
<li>match()</li>
<li>for (i in 1:10) {}</li>
</ul>
</li>
</ul>
<a name="plots"><p id="header">Plots</p></a>
<ul>
<li><u>Formatting</u>:
<ul>
<li>cex.main: Increase font size of chart title. Default is
1.</li>
<li>cex.axis: Increase font size of axes tick lables.
Default is 1.</li>
<li>cex.lab: Increase font size of axes labels. Default is
1.</li>
<li>mar: Set margin size with a vector of length 4. First
value specifies bottom margin, and move clockwise (to the
left). Default setting is c(4.1, 5.1, 5.1, 2.1), which can
be checked with par("mar").</li>
<li>oma</li>
<li>mfrow: Enable multiple plots in the same window with a
vector of the form c(nrows,ncols). Default is c(1,1).</li>
<li>xpd: Enable plotting outside plot region, useful for
when you want to put the legend outside the bounded box.
Can toggle between TRUE and FALSE when you wish. Default
value is FALSE, so all plots are restricted to plot region.
</ul>
<li><u>Legend</u>:
<ul>
<li>legend()</li>
<li>bty: Toggle outline of legend on ("y") and off ("n").
Default is on.</li>
<li>ncol: Force horizontal legend by specifying number of
desired columns. Default number of columns is 1.</li>
<li>cex: Increase font size.</li>
<li>title: Add a title to the top of the legend.</li>
</ul>
</li>
</ul>
<a name="standards"><p id="header">Programming Common Pratices</p></a>
<ul>
<li><a href="https://google.github.io/styleguide/Rguide.xml">Google's R Style Guide</a></li>
</ul>
<a name="resources"><p id="header">R Resources</p></a>
<ul>
<li><a href="https://www.r-project.org">R Home Page</a></li>
<li><a href="https://www.rstudio.com">R GUI Interface</a></li>
<li><a href="https://www.coursera.org/learn/r-programming/">Free Intro to R Course</a></li>
<li><a href="http://www.r-graph-gallery.com">See Ideas for Graphs</a></li>
<li><a href="http://r4ds.had.co.nz/">R for Data Science eBook</a></li>
<li><a href="http://www.studytrails.com/r/15-page-tutorial-for-r/">R Tutorials</a></li>
</ul>
</div>
</td>
</tr>
</table>
</div>
</body>
</html>