/PizzaCourse2atDeltares

basics for pizza course

Primary LanguageHTML

---
title: "Course preparation"
author: "Willem Stolte"
date: "February 8, 2016"
output: html_document
---

##Pizza course "Reproducible and interactive data products and reports in R"

Prior to the course, you should have installed the latest version of R (3.2.2 or newer) and [Rstudio](https://www.rstudio.com/) (Version 0.99.491 or newer)

R can be downloaded from [the Comprehensive R Archive Network - CRAN](https://cran.r-project.org/). 

In this course, a number of packages will be used. Installation of packages can always be done during the course, but to save time, please install the following packages beforehand by running the following code.

```{r, eval=F}
install.packages(c(
  'plyr', 'reshape2', 'ggplot2',
  'scales', 'rmarkdown', 'dplyr',
  'readr', 'tidyr', 'plotly',
  'ncdf4', 'RPostgreSQL', 'sp',
  'rworldmap', 'leaflet', 'rgeos',
  'httr', 'rgdal', 'hexbin', 'ggmap'
))
```

To render Rmarkdown documents to a pdf format, you will need to have installed MikTex (perhaps also LaTeX2RTF, not sure). This can be done via the Deltares Appstore after notice. 

For novices in R, there are loads of online courses to get started with R. For example:

-   An [ICES course](http://ices.dk/news-and-events/Training/Pages/R-environment.aspx) in R is just starting: [online course material](https://github.com/fishvice/tcrenv2016)
-   [Online learning at Rstudio](https://www.rstudio.com/resources/training/online-learning/)

## Data 

The data that we are going to use are made available by Deltares for Rijkswaterstaat and deal with ecological monitoring projects in relation to licencing of e.g. wind parks. The data are made available with web services, which makes the use of those data in R very easy. Data are available as WFS or other formats via a [catalogue](http://marineprojects.openearth.nl/geonetwork/srv/eng/search). WFS can also be derived direcly from the [Geoserver](). 
The adres of one layer (in this case could be something like: "http://marineprojects.openearth.nl/geoserver/mep-nsw/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=mep-nsw:mep-nsw_bivalves&maxFeatures=50&outputFormat=csv", containing the following fields
FID,Meetpunt.identificatie,Metingomschrijving,GeometriePunt.x,GeometriePunt.y,Geometrie,Referentiehorizontaal.code,Monster.identificatie,compartiment.


Background material

1. Learn to work with dynamic documents:
   + [R markdown reports and presentations] (http://rmarkdown.rstudio.com/)
   + [R notebooks] (http://rmarkdown.rstudio.com/r_notebook_format.html)
 
2. Interactive statistical models:
  + [Shiny integration in R markdown Documents] (http://rmarkdown.rstudio.com/authoring_shiny.html)
  + [Shiny apps] (http://shiny.rstudio.com/)
  + [Shiny dashboard] (https://rstudio.github.io/shinydashboard/)

3. Raster products
  + [heatmaps visualization using e.g. ggplot](http://docs.ggplot2.org/current/geom_bin2d.html)
  + [plot raster data](http://docs.ggplot2.org/current/geom_tile.html)
  + [DIVA Interpolation and variational analysis](http://www.seadatanet.org/Standards-Software/Software/DIVA) (some examples will be shown)
  
4.  Data access
    + [Marine Projects data](http://marineprojects.openearth.nl/)
    + [WaterML R package](https://cran.r-project.org/web/packages/WaterML/)

---

Examples:

[R markdown document regridding of bird counts](https://publicwiki.deltares.nl/display/~stolte/R%2C+bird+data+WFS%2C+distribution+maps+and+grids) 

[Interactive statistical models for Waterbase data](https://gammarus.shinyapps.io/ShinyWaterbaseNoordzee) 

[Shiny apps at NIOZ](http://www.rforscience.com/)