title: "README.md" author: "Mark Cherrie" date: "18/09/2019" output: html_document
```{r install, include=F} devtools::install_github("markocherrie/uvR")
* Load the package
```{r load, include=F}
library(uvR)
* Convert that data to something usable
```{r convert, include=F}
uvR::JAXA_convert()
* Visualise the raster
```{r rstviz, include=F}
rst<-raster(list.files("raster/", full.names = T)[1])
plot(rst)
* Visualise the output
```{r summaryvisualise, include=F}
multmerge = function(mypath){
filenames=list.files(path=mypath, full.names=TRUE)
datalist = lapply(filenames, function(x){read.csv(file=x,header=T)})
Reduce(function(x,y) {merge(x,y)}, datalist)
}
# from: https://www.r-bloggers.com/merging-multiple-data-files-into-one-data-frame/
mergedf = multmerge("extract/")
mergedf<-reshape(mergedf, varying=c(3:4), direction="long", idvar="NAME", sep="", timevar="date")
mergedf$date<-as.Date(substr(mergedf$date, 8,15), format="%Y%m%d")
library(ggplot2)
## simple line chart in ggplot
p<-ggplot(data=mergedf, aes(x=date, y=MYD, group=NAME, color=NAME)) +
geom_line() +
geom_point() +
labs(title="Mean daily UVB for Local Authorities in Scotland", x="Date" ,y="UVB (W/m2)")
p
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.