detach("package:wssmartis", unload=TRUE)
remove.packages(pkgs = c("wssmartis"))

if (!require(wssmartis)){
  install.packages(file.choose(),repos=NULL)
  library(wssmartis)
}

library(wssmartis)
help("ws_data_grid")
help("ws_mosicas_grid")
help("validate_credential")
help('ws_alti_m')


help("ws_ru")

start_date = "2022-08-05"
end_date = "2022-08-12"
latitude = "-21.311775"
longitude = "55.577869"
parametres = "rr|vt|tm|tn|tx"
id_station="97416465"


ws_geo_meteo(credential, '2022-08-05','2022-08-12','-21.311775','55.577869')


#credential<-get_credential('mezino',  '9Yvx7UUlSsRs9WR4bjeTpoMCxZjf0z')

credential<-get_credential('guinjard','0fie17p7TdBJGigtmeR05nabXs4NUo')

alti_c_d<-ws_ru(credential,latitude,longitude)
altitude<-as.matrix(ws_alti_dd(credential,latitude,longitude))[1]



geo_data<-ws_geo_meteo(credential,start_date,end_date,latitude,longitude)
View(geo_data)

data_h_pied_station <- ws_station_meteo(credential,id_station,start_date,end_date,parametres,'H')

View(data_h_pied_station)

r<-GET(url,add_headers(Accept='application/json'))
r



