datacarpentry / NEON-R-Tabular-Time-Series

These data tutorials complement the spatio-temporal lessons (raster and vector) in R lessons. These lessons are close to being published on the neondataskills.org website.
http://neon-workwithdata.github.io/NEON-R-Tabular-Time-Series
6 stars 6 forks source link

Tutorial 06 - Final Challenge #98

Closed lwasser closed 8 years ago

lwasser commented 8 years ago

the final challenge reads as follows: This challenge is confusing because for it to work properly - you have to reimport the CSV which has a month-year formatted date column. Then the ZOO (part two of the challenge) code can work. @mjones01 do you know why we did this - this way? Couldn't we just have them create the plot once and use too to format that data using zoo. this is why the code is breaking now?

## Challenge: Plot with Year-Month Data
Create two faceted plots of annual air temperature for each year of data in the
file (2001-2015). Use the
`NEON-DS-Met-Time-Series/HARV/FisherTower-Met/hf001-04-monthly-m.csv` 
file. This contains monthly average data for the NEON Harvard Forest field site.

Create one plot using the methods for base `R` and create the second plot using
the methods with the `zoo` package.  

Experiment on your own to figure out the methods that you prefer!
lwasser commented 8 years ago

@mjones01 this lesson has been updated. please have a look. i'm still concerned it's a bit confusing as is BUT if you think it's clear enough for now. let's close this issue! Al lessons are current now (all RMD files) on the repo! If you want me to push the build up - please let me know.

mjones01 commented 8 years ago

As long as RMD files are current. We'll rebuild once all edits are done tomorrow/Friday.

lwasser commented 8 years ago

Ok - everything is current. Will you please have a look at L06 final challenge when you have a bit of time? It was hard to write in a clear way. One option - rather than having them plot twice - we could have them

  1. Convert date field using yearmon and asDate as the first part of the challenge.
  2. Have them plot and subset because those steps are the SAME regardless of whether they use ZOO or base R.

I'm inclined to do it this way. Have a look and see what you think.

mjones01 commented 8 years ago

Broken up into two challenges: first, convert in 2 ways; second, plot.

Challenge: Convert Year-Month Data

The goal of this challenge is to use both the base R and the zoo package methods for working with year-month data.

Using the NEON-DS-Met-Time-Series/HARV/FisherTower-Met/hf001-04-monthly-m.csv file (name = met_monthly_HARV):

  1. Convert the date field into a date/time class using both base R and the zoo package. Name the new fields date_base and yearmon respectively.
  2. Look at the format and check the class of both new date fields.
  3. Convert the yearmon field into a Date class field so it can be used in base R, ggplot, etc.

HINT: be sure to load the zoo package, if you have not already.

Challenge: Plot Year-Month Data

Using the date data in the Date class from the previous challenge, create a faceted plot of annual air temperature for each year (2001-2015) for the NEON Harvard Forest field site.

mjones01 commented 8 years ago

(note "date data" in challenge 2 changed to "date field")

lwasser commented 8 years ago

Ok please edit as follows below. You never want to use a method or function as a variable or field name. it can cause problems. But also date_base refers to base r. so it makes sense to use date_zoo to be consistent. The first part above though is more significant of a problem for new users.


  1. Convert the date field into a date/time class using both base R and the zoo package. Name the new fields date_base and date_zoo respectively.
  2. Look at the format and check the class of both new date fields.
  3. Convert the date_zoo field into a Date class field so it can be used in base R, ggplot, etc.
lwasser commented 8 years ago

Please edit:

Using the date data in the Date class from the previous challenge, create a faceted plot of annual air temperature for each year (2001-2015) for the NEON Harvard Forest field site.

CHANGE TO:

Using the date field date_base that you created in part one of the challenge above, create a faceted plot of annual air temperature for each year (2001-2015) for the NEON Harvard Forest field site.


If you'd rather have them use date_zoo that's fine. But the text above was confusing.

Also we haven't been breaking up challenges in terms of having 2 separate ones. We've just been doing part one and part two, etc. More minor of a comment. Thanks!

mjones01 commented 8 years ago

Addressed in PR #102 Closing issue.