Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

Commit

Permalink
Update first few exercises
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam M. Wilson committed Jul 7, 2016
1 parent 4a38aaf commit 96a7f52
Show file tree
Hide file tree
Showing 166 changed files with 13,605 additions and 504 deletions.
7 changes: 6 additions & 1 deletion 00_CourseIntroduction/00_CourseIntroduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ Learning a programming language can help you learn how to think

---

<blockquote>
"The computer is incredibly fast, accurate, and stupid. Man is unbelievably slow, inaccurate, and brilliant. <br> <br> The marriage of the two is a force beyond calculation." <br> -– Leo Cherne
</blockquote>

## UBLearns.buffalo.edu


Expand Down Expand Up @@ -185,8 +189,9 @@ RStudio
# Assessment / Grading

* **Course Participation (10%)** Actively participation
* **Package Presentation (10%)** Overview of a R package of your choice
* **Homeworks (30%)**
* **Final Project (60%)** a dynamically generated report of a spatial analysis related to each student’s interest. Report will be uploaded to UBlearns as a PDF file with RMarkdown source code. This project can be related to the student’s own research or a separate topic.
* **Final Project (50%)** a dynamically generated set of figures (like an infographic) of a spatial analysis related to each student’s interest. Report will be uploaded to UBlearns as a PDF file with RMarkdown source code. This project can be related to the student’s own research or a separate topic.

## Homework
Working collaboratively is encouraged but you are responsible for developing your own code to answer the questions.
Expand Down
6 changes: 6 additions & 0 deletions 00_CourseIntroduction/00_CourseIntroduction.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ <h2 data-config-subtitle><!-- populated from slide_config.json --></h2>

</article></slide><slide class=''><hgroup><h2></h2></hgroup><article >

<blockquote>

&quot;The computer is incredibly fast, accurate, and stupid. Man is unbelievably slow, inaccurate, and brilliant. <br> <br> The marriage of the two is a force beyond calculation.&quot; <br> -– Leo Cherne

</blockquote>

</article></slide><slide class=''><hgroup><h2>UBLearns.buffalo.edu</h2></hgroup><article id="ublearns.buffalo.edu">

</article></slide><slide class=''><hgroup><h2>Class Survey</h2></hgroup><article id="class-survey">
Expand Down
1 change: 1 addition & 0 deletions 01_intro.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ x+2

## ----eval=FALSE----------------------------------------------------------
## X
## Error: object 'X' not found

## ------------------------------------------------------------------------
x
Expand Down
4 changes: 2 additions & 2 deletions 01_intro.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ knitr::purl(input,output,documentation=1,quiet=T,envir=new.env())
knitr::opts_chunk$set(cache=TRUE)
```

This file is available as a [<i class="fa fa-file-text" aria-hidden="true"></i> R script here](`r output`)
This file is available as a [<i class="fa fa-file-text" aria-hidden="true"></i> R script here](`r output`). Download this file and open it (or copy-paste into a new script) with RStudio so you can follow along.

## Variables
```{r}
Expand Down Expand Up @@ -46,9 +46,9 @@ y=15
Note that `R` is case sensitive, if you ask for `X` instead of `x`, you will get an error
```{r,eval=FALSE}
X
Error: object 'X' not found
```

`Error: object 'X' not found`

### Variable naming conventions

Expand Down
72 changes: 49 additions & 23 deletions 01_intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
h6 {
font-size: 12px;
}
.table th:not([align]) {
text-align: left;
}
</style>

<link rel="stylesheet" href="styles.css" type="text/css" />
Expand Down Expand Up @@ -166,6 +169,12 @@

<script>
$(document).ready(function () {

// move toc-ignore selectors from section div to header
$('div.section.toc-ignore')
.removeClass('toc-ignore')
.children('h1,h2,h3,h4,h5').addClass('toc-ignore');

// establish options
var options = {
selectors: "h1,h2,h3",
Expand All @@ -174,7 +183,7 @@
hashGenerator: function (text) {
return text.replace(/[.\/?&!#<>]/g, '').replace(/\s/g, '_').toLowerCase();
},
ignoreSelector: "h1.title, .toc-ignore",
ignoreSelector: ".toc-ignore",
scrollTo: 0
};
options.showAndHide = true;
Expand Down Expand Up @@ -271,20 +280,8 @@
<li>
<a href="Syllabus.html">Syllabus</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Assignments

<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="Project.html">Final Project</a>
</li>
<li>
<a href="Homework.html">Homeworks</a>
</li>
</ul>
<li>
<a href="Schedule.html">Schedule</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Expand All @@ -303,6 +300,17 @@
<li>
<a href="02_DataWrangling.html">Data Wrangling</a>
</li>
<li>
<a href="03_Plotting.html">Plotting</a>
</li>
<li class="divider"></li>
<li class="dropdown-header">Module 2: Spatial Analyses</li>
<li>
<a href="04_Spatial.html">Spatial Data</a>
</li>
<li>
<a href="05_Raster.html">Spatial Raster Data</a>
</li>
<li class="divider"></li>
<li class="dropdown-header">Module 2: Advanced Programming</li>
<li>
Expand All @@ -315,6 +323,24 @@
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Assignments

<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="Homework.html">Homeworks</a>
</li>
<li>
<a href="PackageIntro.html">Package Introduction</a>
</li>
<li>
<a href="Project.html">Final Project</a>
</li>
</ul>
</li>
<li>
<a href="Resources.html">Resources</a>
</li>
Expand All @@ -335,12 +361,12 @@



<h1 class="title">Introduction to R</h1>
<h1 class="title toc-ignore">Introduction to R</h1>

</div>


<p>This file is available as a <a href="01_intro.R"><i class="fa fa-file-text" aria-hidden="true"></i> R script here</a></p>
<p>This file is available as a <a href="01_intro.R"><i class="fa fa-file-text" aria-hidden="true"></i> R script here</a>. Download this file and open it (or copy-paste into a new script) with RStudio so you can follow along.</p>
<div id="variables" class="section level2">
<h2>Variables</h2>
<pre class="r"><code>x=1
Expand All @@ -363,8 +389,8 @@ <h2>Variables</h2>
</div>
</div>
<p>Note that <code>R</code> is case sensitive, if you ask for <code>X</code> instead of <code>x</code>, you will get an error</p>
<pre class="r"><code>X</code></pre>
<p><code>Error: object 'X' not found</code></p>
<pre class="r"><code>X
Error: object &#39;X&#39; not found</code></pre>
<div id="variable-naming-conventions" class="section level3">
<h3>Variable naming conventions</h3>
<p>Naming your variables is your business, but there are <a href="http://www.r-bloggers.com/consistent-naming-conventions-in-r/">5 conventions</a> to be aware of:</p>
Expand Down Expand Up @@ -540,10 +566,10 @@ <h2>Matrices</h2>
</button>
<div id="demo4" class="collapse">
<pre class="r"><code>matrix(rnorm(9),nrow=3)</code></pre>
<pre><code>## [,1] [,2] [,3]
## [1,] -0.08001421 -1.0258084 -0.39961186
## [2,] -0.97271547 -1.1043868 -0.09772124
## [3,] 0.04901584 0.2091166 0.51971660</code></pre>
<pre><code>## [,1] [,2] [,3]
## [1,] 0.3606916 0.7006843 -0.4335982
## [2,] -1.5070465 0.7237667 0.0937146
## [3,] 0.8981938 0.8758926 -0.1065538</code></pre>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 96a7f52

Please sign in to comment.