Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@cvitolo
cvitolo / thankyou_wordcloud.R
Created October 4, 2019 11:13
Thank you wordcloud
# devtools::install_github("lepennec/ggwordcloud")
library(ggwordcloud)
library(dplyr)
library(colorspace)
data("thankyou_words")
thankyou_words <- thankyou_words %>%
mutate(angle = 45 * sample(-2:2, n(), replace = TRUE,
prob = c(1, 1, 4, 1, 1)))
@cvitolo
cvitolo / rnrfa_BigDataApplication.Rmd
Last active December 23, 2016 13:16
Big data analytics experiment using the rnrfa package
---
title: "Big Data analytics using the rnrfa package"
author: "Claudia Vitolo"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE,
message = FALSE,
cache = FALSE,
@cvitolo
cvitolo / rnrfa_stationsEU-NUTS1regions.Rmd
Created September 1, 2016 15:38
Geoprocessing based on user-defined areas using the rnrfa package
---
title: "NRFA stations in EU-NUTS1 regions"
author: "Claudia Vitolo"
date: "13 March 2016"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE,
message = FALSE,
@cvitolo
cvitolo / rnrfa_DynamicReportingMapping.Rmd
Last active September 1, 2016 15:20
Dynamic Reporting and Mapping application using the rnrfa package
---
title: "RNRFA application for dynamic mapping and reporting"
author: "Claudia Vitolo"
runtime: shiny
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE,
message=FALSE,
@cvitolo
cvitolo / RSSdemo.Rmd
Last active January 1, 2016 19:18
Dynamic Report - Demo for the talk on "Improving access to geospatial Big Data in the hydrology domain" - Royal Statistical Society 18.11.2015
---
title: "RNRFA: an R package to interact with the UK National River Flow Archive"
author: "Claudia Vitolo"
date: "18 November 2015"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(cache=TRUE)
```
@cvitolo
cvitolo / GenerateFUSEParameters.R
Last active August 29, 2015 14:21
This function generates parameter sets for FUSE (Clark et al., 2008)
#' This function generates parameter sets for FUSE (Clark et al., 2008).
#'
#' @param NumberOfRuns number of samples to generate, can be any integer
#' @param SamplingType sampling procedure to use, can be "URS" or "LHS"
#' @param rferr_add range of the additive rainfall error (mm), default is c(0,0)
#' @param rferr_mlt range of the multiplicative rainfall error (-), default is c(1,1)
#' @param maxwatr_1 range of the depth of the upper soil layer (mm), default is c(25,500)
#' @param maxwatr_2 range of the depth of the lower soil layer (mm), default is c(50,5000)
#' @param fracten range of the fraction total storage in tension storage (-), default is c(0.05,0.95)
#' @param frchzne range of the fraction tension storage in recharge zone (-), default is c(0.05,0.95)
@cvitolo
cvitolo / FUSEinfo.R
Last active August 29, 2015 14:21
This function returns information on model structure components and parameters used, given a FUSE model.
#' This function returns information on model structure components and parameters used, given FUSE model.
#'
#' @param mid FUSE model structure ID number (integer from 1 to 1248).
#' @number default is TRUE (returns the model options numbers, if FALSE it returns model options names)
#'
#' @examples
#' # FUSEinfo(mid=60)
#'
FUSEinfo <- function(mid, number=TRUE) {
@cvitolo
cvitolo / ts2years.R
Last active August 29, 2015 14:10
Split long time series into (hydrological) years in R
# Load library
library(xts)
# Generate dummy time series
from <- as.Date("1950-01-01")
to <- as.Date("1990-12-31")
myDates <- seq.Date(from=from,to=to,by="day")
myTS <- as.xts(runif(length(myDates)),order.by=myDates)
# SPLIT THE TIME SERIES INTO CALENDAR YEARS
@cvitolo
cvitolo / GenerateMap.R
Last active August 29, 2015 14:06
Generate map of UK NRFA stations
#' Generate map of gauging stations.
#'
#' @author Claudia Vitolo <cvitolodev@gmail.com>
#'
#' @description This function takes as input a table of UK NRFA stations (output of getStationSummary() function) and generates a map using leaflet javascript library.
#'
#' @param selectedStationSummary This is the data.frame containing at least a column called "gridReference" (in which OS Grid references are stored) with 1 row for each station. Alternatively the table could contain 2 columns called "Latitude" and "Longitude" containing the coordinates of stations in WGS84, with 1 row for each station.
#'
#' @return displays a map
#'