Commit f8059ad4 authored by Laura Poggio's avatar Laura Poggio

test spring school

parent bf3f1f65
FROM laurapoggio/cos8dfs:jupyt
FROM laurapoggio/cos8dfs:ss
COPY . ${HOME}
USER root
......
......@@ -5,7 +5,7 @@
## Binder
R+Jupyter: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/git/https%3A%2F%2Fgit.wur.nl%2Fpoggi002%2Freproduc-test/master?filepath=testRspat.ipynb)
R+Jupyter SpringSchool: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/git/https%3A%2F%2Fgit.wur.nl%2Fpoggi002%2Freproduc-test/master?filepath=exampleSpringSchoolEnvironDSM.ipynb)
## Colab (not working yet)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/git/https%3A%2F%2Fgit.wur.nl%2Fpoggi002%2Freproduc-test/master/test.ipynb)
......
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## TEST R - example 1\n",
"-------------------------"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"library(GSIF)\n",
"library(plotKML)\n",
"library(sp)\n",
"library(plyr)\n",
"library(gstat)\n",
"library(randomForest)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"demo(meuse, echo=FALSE)\n",
"omm <- fit.gstatModel(meuse, om~dist+ffreq, meuse.grid, family = gaussian(log))\n",
"om.rk <- predict(omm, meuse.grid)\n",
"plot(om.rk)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## TEST R - example 2\n",
"------------------------------"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"library(sp)\n",
"library(gstat)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"data(meuse)\n",
"coordinates(meuse) = ~x+y\n",
"data(meuse.grid)\n",
"gridded(meuse.grid) = ~x+y\n",
"m <- vgm(.59, \"Sph\", 874, .04)\n",
"# ordinary kriging:\n",
"x <- krige(log(zinc)~1, meuse, meuse.grid, model = m)\n",
"spplot(x[\"var1.pred\"], main = \"ordinary kriging predictions\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## TEST R - Google Earth\n",
"------------------------------"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plotKML(om.rk)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## TEST R - GDAL \n",
"------------------------------"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"library(rgdal)\n",
"library(gdalUtils)\n",
"\n",
"# reproject to WGS84\n",
"gdalwarp(' DEMSRT6.sdat DEMSRT6_ll.tif -t_srs \\\"+proj=longlat +datum=WGS84\\\"')\n",
"\n",
"# plot map\n",
"plot(raster(\"DEMSRT6_ll.tif\"))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "R",
"language": "R",
"name": "ir"
},
"language_info": {
"codemirror_mode": "r",
"file_extension": ".r",
"mimetype": "text/x-r-source",
"name": "R",
"pygments_lexer": "r",
"version": "3.6.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment