R Library to access SolarDB database
Please install first the devtools
library :
install.packages("devtools")
Then install package rSolarDB
from Github :
devtools::install_github("LE2P/rSolarDB")
You will also need a token to allow access data, please use the register method at https://solardb.univ-reunion.fr to register and obtain a token by email.
OPTIONAL : You can first configure the ~/.Renviron
file in your home directory
to allow rSolarDB
package to know your authentication token. If set, the package
will automatically launch login()
on package load.
solardb_token=YOURTOKENHERE
login()
# OR without configure .Renviron
login(token="PUTYOURTOKENHERE")
status()
logout()
sites()
types()
sensors()
sensors(sites="leportbarbusse")
Get raw data from SolarDB (date store into string):
# Last 7 days on Piton des Neiges and Saint Louis Jean Joly
d <- getData(sites = "saintlouisjeanjoly,pitondesneiges", start = "-7d", type = "GHI")
d$saintlouisjeanjoly$GHI_pr01_Avg$values %>% plot(type='l')
d$pitondesneiges$GHI_qu01_Avg$values %>% lines(type='l', col=2)
Get data from SolarDB using time series library Xts :
d <- getXtsData(sites = "pitondesneiges", start = "-7d", type = "GHI,DHI")
plot(d$pitondesneiges$GHI_qu01_Avg)
lines(d$pitondesneiges$DHI_qu01_Avg, col = '2')
Plot Xts data using dygraph :
library(dygraphs)
dd <- cbind(d$pitondesneiges$DHI_qu01_Avg, d$pitondesneiges$GHI_qu01_Avg)
dygraph(dd) %>% dyRangeSelector()
Get data into data.table
format :
iosnet <- c("amitie", "anseboileau", "antananarivo", "diego", "hahaya", "ouani", "reservetortues", "vacoas")
d <- getDtData(sites = iosnet, types = "GHI,DHI")
d
campaigns()
campaigns(territory = "Mauritius")
measures()
measures(type="DHI")
measures(type="DHI", nested=TRUE)
instruments()
models()
models(type = "Meteorological")
Shiny app to plot a calendar with count of missing data for each day. To launch app :
missings()