Skip to content

Commit 936fd59

Browse files
author
Leah Wasser
authored
Merge pull request #85 from earthlab/dev-lessons
Dev lessons merge into dev
2 parents 0ddaba0 + ff2c45b commit 936fd59

File tree

110 files changed

+5882
-1279
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+5882
-1279
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,11 @@ bundle exec jekyll serve
4444
## Build Notes:
4545

4646
* the site requires jekyll flavored markdown. Be sure to specify that if you are knitting.
47-
* in rmd files - be sure to specify fig.cap="text here" to add alt text to any code chunks that output a FIGURE.
47+
* in rmd files - be sure to specify fig.cap="text here" to add alt text to any code chunks that output a FIGURE.
48+
49+
## CSS
50+
51+
Currently, we are using less. to install less
52+
53+
1. install nodejs (npm) https://nodejs.org/en/
54+
2. install less : `sudo npm install less -g` NOTE: you need administration access to install

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ kramdown:
137137
auto_ids: true
138138
footnote_nr: 1
139139
entity_output: as_char
140-
toc_levels: 1..6
140+
toc_levels: 1..3
141141
smart_quotes: lsquo,rsquo,ldquo,rdquo
142142
enable_coderay: false
143143

_data/navigation.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ earth-analytics-2017:
4343
url: /course-materials/earth-analytics/
4444
- title: "Syllabus"
4545
url: /course-materials/earth-analytics/earth-analytics-syllabus/
46-
- title: "WK 1-3: Intro to R & Disturbance"
46+
- title: "Course Weeks 1-3"
4747
children:
48-
- title: "Wk 1: Introduction "
48+
- title: "Week 1: Getting Started With Data"
4949
url: /course-materials/earth-analytics/week-1/
50-
- title: "Wk 2: Flood Data in R "
50+
- title: "Week 2: Time Series Data in R"
5151
url: /course-materials/earth-analytics/week-2/
52-
- title: "Wk 3: Lidar Data in R"
52+
- title: "Week 3: Lidar Data in R"
5353
url: /course-materials/earth-analytics/week-3/

_events/courses/2017-01-17-earth-analytics-course.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ header:
1111
cta_url:
1212
overlay_filter: rgba(0, 0, 0, 0.5)
1313
caption:
14-
excerpt: 'Earth Analytics Spring 2017 - Fuse data science skills with Earth system science knowledge.'
14+
excerpt: 'Earth Analytics Spring 2017 - Fuse Data Science Skills with Earth System Science Knowledge.'
1515
sidebar:
1616
nav: earth-analytics-2017
1717
startTime: '3:00'
1818
endTime: '17:50'
1919
---
2020

21-
## About
21+
## Earth Analytics Course Home
2222

2323
This advanced, multidisciplinary course will address major questions in Earth
2424
science and teach students to use the analytical tools necessary to undertake
25-
exploration of ‘big scientific data’. If you are a graduate and undergraduate
25+
exploration of ‘big scientific data’. If you are a graduate or undergraduate
2626
(junior/senior) student in the natural/social science disciplines with an
2727
interest in learning about computationally intensive science, this
2828
course is for you.
@@ -36,13 +36,13 @@ course is for you.
3636
* **Teaching Assistant:** Sepideh Khanghah
3737
* **Time:** Wednesday 3:00 pm - 5:50 pm
3838
* **Location:** SEEC S125
39-
* **Sections:** GEOG 4100-001 (Junior / Senior Level undergraduate), GEOG 5100-003 (Graduate)
39+
* **Sections:** GEOG 4563 (Junior / Senior Level undergraduate), GEOG 5563 (Graduate)
4040

4141
Please direct questions to Leah Wasser (leah.wasser at colorado.edu).
4242

4343
</div>
4444

45-
### Example Course Science Topics (Topics subject to change):
45+
### Example Science Topics:
4646

4747
* **Climate & Disturbance (Fire / Drought / Permafrost):** How
4848
changing climate impacts natural disturbance systems.

_includes/class_navigation.html

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
2+
3+
4+
5+
6+
<nav class="nav__list">
7+
<ul>
8+
<li><span class="nav__sub-title"><i class="fa fa-book" aria-hidden="true"></i> {{ page.class-lesson | replace: '-',' ' | replace: '"',' ' | remove: ']' | remove: '['}} Lessons</span>
9+
<ul>
10+
{% assign sorted_posts = site.posts | sort:"order" %}
11+
{% for post in sorted_posts %}
12+
{% if post.class-lesson == page.class-lesson %}
13+
{% if post.url == page.url %}
14+
<li><a href= {{ site.url }}{{ site.baseurl }}{{ post.url }} class='active'>{{ post.order }}. {{ post.nav-title }}</a></li>
15+
{% else %}
16+
<li><a href= {{ site.url }}{{ site.baseurl }}{{ post.url }}>{{ post.order }}. {{ post.nav-title }}</a></li>
17+
{% endif %}
18+
{% endif %}
19+
{% endfor %}
20+
</ul>
21+
</li>
22+
</ul>
23+
<!-- slide list will only render if there are slideshows associated with a lesson series -->
24+
{% for slides in site.slide-shows %}
25+
{% if slides.class-lesson == page.class-lesson %}
26+
{% if forloop.first %}
27+
<ul>
28+
<li><span class="nav__sub-title">Slide Shows</span>
29+
<ul>
30+
{% endif %}
31+
<li><a href="{{ site.url }}{{ site.baseurl }}{{ slides.url}}" target='_blank'>{{ slides.title }} </a></li>
32+
{% endif %}
33+
{% if forloop.last %}
34+
</ul>
35+
</li>
36+
</ul>
37+
{% endif %}
38+
{% endfor %}
39+
<!-- end slideshows -->
40+
</nav>
41+
42+
<h3>Other Week {{ page.week }} Lessons</h3>
43+
44+
{% assign modules = site.posts | where:"order", 1 %}
45+
{% assign weeks = modules | where:"week", page.week %}
46+
47+
{% for module in weeks %}
48+
{% if module.class-lesson != page.class-lesson %}
49+
<nav class="nav__list">
50+
<a href="{{ site.url }}{{ module.permalink }}">
51+
<ul>
52+
<li><span class="nav__sub-title grey"><i class="fa fa-book" aria-hidden="true"></i> {{ module.module-title | replace: '-',' ' | replace: '"',' ' | remove: ']' | remove: '['}} Lessons</span>
53+
</ul></a>
54+
</nav>
55+
{% endif %}
56+
{% endfor %}
57+
58+
<!-- Only add this if the page has a week asociated with it -->
59+
{% if page.week %}
60+
{% capture the_path %}{{ site.url }}/course-materials/earth-analytics/week-{{ page.week }}/{% endcapture %}
61+
62+
<a href="{{ the_path }}" ><i class="fa fa-arrow-circle-left"></i> Return to week {{ page.week }}</a>
63+
64+
{% endif %}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{% assign sorted_posts = site.posts | sort:"order" %}
2+
<!--<h3>Week {{ page.week }} Lessons</h3>-->
3+
4+
{% assign modules = site.posts | where:"order", 1 %}
5+
6+
{% assign weeks = sorted_posts | where:"week", page.week %}
7+
8+
{% assign classes = weeks | where:"module-type", 'class' %}
9+
{% assign homework = weeks | where:"module-type", 'homework' %}
10+
11+
{% if page.week %}
12+
{% capture the_path %}{{ site.url }}/course-materials/earth-analytics/week-{{ page.week }}/{% endcapture %}
13+
<h4><a href="{{ the_path }}" ><i class="fa fa-home" aria-hidden="true"></i> Week {{ page.week }}</a></h4>
14+
{% endif %}
15+
<nav class="nav__list">
16+
<ul>
17+
<li><span class="nav__sub-title"><i class="fa fa-folder-open" aria-hidden="true"></i> In Class Materials</span>
18+
<ul>
19+
{% for module in classes %}
20+
{% if module.order == 1 %}
21+
{% assign class_lessons = weeks | where:"class-lesson", module.class-lesson %}
22+
<li><span class="nav__sub-title grey"><i class="fa fa-book" aria-hidden="true"></i> {{ module.module-nav-title | capitalize }} </span></li>
23+
{% endif %}
24+
25+
<ul>
26+
{% for alesson in class_lessons %}
27+
{% if alesson.url == page.url %}
28+
<li><a href= {{ site.url }}{{ alesson.url }} class='active'>{{ alesson.order }}. {{ alesson.nav-title }}</a></li>
29+
{% else %}
30+
<li><a href= {{ site.url }}{{ alesson.url }}>{{ alesson.order }}. {{ alesson.nav-title }}</a></li>
31+
{% endif %}
32+
{% endfor %}
33+
</ul>
34+
{% endfor %}
35+
</ul>
36+
37+
<li><span class="nav__sub-title"><i class="fa fa-folder-open" aria-hidden="true"></i> Homework Materials</span>
38+
<ul>
39+
{% for module in homework %}
40+
{% if module.order == 1 %}
41+
{% assign class_lessons = weeks | where:"class-lesson", module.class-lesson %}
42+
<li><i class="fa fa-book" aria-hidden="true"></i> {{ module.module-nav-title }} </li>
43+
{% endif %}
44+
45+
<ul>
46+
{% for alesson in class_lessons %}
47+
{% if alesson.url == page.url %}
48+
<li><a href= {{ site.url }}{{ alesson.url }} class='active'>{{ alesson.order }}. {{ alesson.nav-title }}</a></li>
49+
{% else %}
50+
<li><a href= {{ site.url }}{{ alesson.url }}>{{ alesson.order }}. {{ alesson.nav-title }}</a></li>
51+
{% endif %}
52+
{% endfor %}
53+
</ul>
54+
{% endfor %}
55+
</ul>
56+
</ul>
57+
</nav>
58+
59+
60+
{% if page.week %}
61+
{% if page.week > 1 and page.week <= 4 %}
62+
<hr>
63+
{% assign previousWeek = page.week | minus: 1 %}
64+
{% capture previous_week_path %}{{ site.url }}/course-materials/earth-analytics/week-{{ previousWeek }}/{% endcapture %}
65+
<h5><a href="{{ previous_week_path }}" ><i class="fa fa-arrow-circle-left"></i> {{ previousWeek }} </a>
66+
go to week
67+
{% endif %}
68+
69+
70+
{% if page.week == 1 %}
71+
{% assign nextWeek = page.week | plus: 1 %}
72+
{% capture next_week_path %}{{ site.url }}/course-materials/earth-analytics/week-{{ nextWeek }}/{% endcapture %}
73+
<h5>go to week<a href="{{ next_week_path }}" > {{ nextWeek }} <i class="fa fa-arrow-circle-right"></i> </a></h5>
74+
{% endif %}
75+
{% if page.week >= 2 and page.week <= 3 %}
76+
{% assign nextWeek = page.week | plus: 1 %}
77+
{% capture next_week_path %}{{ site.url }}/course-materials/earth-analytics/week-{{ nextWeek }}/{% endcapture %}
78+
79+
<a href="{{ next_week_path }}" > {{ nextWeek }} <i class="fa fa-arrow-circle-right"></i> </a></h5>
80+
{% endif %}
81+
82+
{% endif %}
83+
84+
<h5><a href="{{ site.url }}/course-materials/earth-analytics/" ><i class="fa fa-home" aria-hidden="true"></i> Course Home</a></h5>
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
<!-- start homework activity -->
2+
3+
4+
<div class="notice--warning" markdown="1">
5+
6+
## <i class="fa fa-pencil-square-o" aria-hidden="true"></i> Homework Submission: Create A Report Using Knitr & RMarkdown
7+
8+
* Create a new rmarkdown `.Rmd` file in `Rstudio`. Name the file:
9+
`yourLastName-firstInitial-week1.Rmd` example: `wasser-l-week1.Rmd`
10+
11+
* Add an `author:` line to the `YAML` header at the top of your `.Rmd` document.
12+
* Give your file an appropriate title. Suggestion: `Earth Analytics Spring 2017: Homework - Week 1`
13+
* At the top of the rmarkdown document (BELOW THE YAML HEADER), add some text
14+
that describes:
15+
16+
* What an `.Rmd` file is
17+
* How you can use `knitr` in `R` and what it does.
18+
* Why using `Rmarkdown` to create reports can be helpful to both you and your colleagues that you work with on a project.
19+
20+
* Create a new CODE CHUNK
21+
* Copy and paste the code BELOW into the code chunk that you just created.
22+
* Below the code chunk in your `rmarkdown` document, add some TEXT that describes what the plot that you created
23+
shows - interpret what you see in the data.
24+
* Finally, in your own words, summarize what you think the plot shows / tells us about
25+
the flood and also how the data that produced the plot were likely collected. Use the video
26+
about the Boulder Floods as a reference when you write this summery.
27+
28+
BONUS: If you know `R`, clean up the plot by adding labels and a title. Or better
29+
yet, use `ggplot2`!
30+
31+
</div>
32+
33+
34+
```r
35+
36+
# load the ggplot2 library for plotting
37+
library(ggplot2)
38+
39+
# download data from figshare
40+
# note that we are downloaded the data into your
41+
download.file(url = "https://ndownloader.figshare.com/files/7010681",
42+
destfile = "data/boulder-precip.csv")
43+
44+
# import data
45+
boulder.precip <- read.csv(file="data/boulder-precip.csv")
46+
47+
# view first few rows of the data
48+
head(boulder.precip)
49+
50+
# when we download the data we create a dataframe
51+
# view each column of the data frame using it's name (or header)
52+
boulder.precip$DATE
53+
54+
# view the precip column
55+
boulder.precip$PRECIP
56+
57+
# q plot stands for quick plot. Let's use it to plot our data
58+
qplot(x=boulder.precip$DATE,
59+
y=boulder.precip$PRECIP)
60+
61+
```
62+
63+
<figure class="half">
64+
<a href="/images/rfigs/course-materials/earth-analytics/week-1/intro-knitr-rmd/2016-12-06-Rmd05-knitr/render-plot-1.png">
65+
<img src="/images/rfigs/course-materials/earth-analytics/week-1/intro-knitr-rmd/2016-12-06-Rmd05-knitr/render-plot-1.png" alt="example of the plot">
66+
</a>
67+
<figcaption>
68+
If your code ran properly, the resulting plot should look like this one.
69+
</figcaption>
70+
</figure>
71+
72+
73+
<figure>
74+
<a href="/images/course-materials/earth-analytics/week-1/setup-r-rstudio/r-markdown-wk-1.png">
75+
<img src="/images/course-materials/earth-analytics/week-1/setup-r-rstudio/r-markdown-wk-1.png" alt="R markdown example image.">
76+
</a>
77+
<figcaption>
78+
Your rmarkdown file should look something like the one above (with your own text
79+
added to it). Note that the imaglocalhoste above is CROPPED at the bottom. Your rmarkdown
80+
file will have more code in it.
81+
</figcaption>
82+
</figure>
83+
84+
### Troubleshooting: missing plot
85+
86+
If the code above did not produce a plot, please check the following:
87+
88+
#### Check your working directory
89+
90+
If the path to your file is not correct, then the data won't load into `R`.
91+
If the data don't load into `R`, then you can't work with it or plot it.
92+
93+
To figure out your current working directory use the command: `getwd()`
94+
Next, go to your finder or file explorer on your computer. Navigate to the path
95+
that `R` gives you when you type `getwd()` in the console. It will look something
96+
like the path example: `/Users/your-username/documents/earth-analytics`
97+
98+
```r
99+
# check your working directory
100+
getwd()
101+
102+
## [1] "/Users/lewa8222/documents/earth-analytics"
103+
```
104+
105+
In the example above, note that my USER directory is called `lewa8222`. Yours
106+
is called something different. Is there a `data` directory within the earth-analytics
107+
directory?
108+
109+
<figure>
110+
<a href="/images/course-materials/earth-analytics/week-1/setup-r-rstudio/data-dir-wk-1.png">
111+
<img src="/images/course-materials/earth-analytics/week-1/setup-r-rstudio/data-dir-wk-1.png" alt="data directory example image.">
112+
</a>
113+
<figcaption>
114+
Your working directory should contain a `/data` directory.
115+
</figcaption>
116+
</figure>
117+
118+
If not, review the [working directory lesson](/course-materials/earth-analytics/week-1/setup-working-directory/)
119+
to ensure your working directory is SETUP properly on your computer and in `RStudio`.
120+
121+
122+
<!-- end homework activity -->

_includes/lesson-pagination.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
<!-- NOTE: it won't include slideshows as written which makes sense -->
33
<!-- add forced pagination -->
44
<!-- first, get total lesson count -->
5+
6+
<div class="previous--next">
7+
58
{% assign counter = 0 %}
69
{% for post in site.categories.course-materials %}
710
{% if post.class-lesson == page.class-lesson %}
@@ -18,14 +21,15 @@
1821
{% if post.order == prevPageNum %}
1922
<a href="{{ site.url }}{{ site.baseurl }}{{ post.url }}" class="btn btn--info btn--large btn-success">
2023
<i class="fa fa-4 fa-arrow-circle-left fa-4" aria-hidden="true"></i>
21-
PREVIOUS - {{ post.nav-title }} </a>
24+
{{ post.nav-title }} </a>
2225
{% endif %}
2326

2427
{% assign nextPageNum = page.order | plus: 1 %}
2528
{% if post.order == nextPageNum %}
2629
<a href="{{ site.url }}{{ site.baseurl }}{{ post.url }}" class="btn btn--info btn--large btn-success" style="float:right" >
27-
{{ post.nav-title }} - NEXT
30+
{{ post.nav-title }}
2831
<i class="fa fa-4 fa-arrow-circle-right" aria-hidden="true"></i></a>
2932
{% endif %}
3033
{% endif %}
3134
{% endfor %}
35+
</div>

0 commit comments

Comments
 (0)