Learn R Programming

meteoland (version 1.0.3)

reshapeweather: Reshapes weather data from 'meteospain', 'worldmet' or 'weathercan'

Description

Reshapes weather station data acquired using the 'meteospain', 'worldmet' or 'weathercan' R packages into formats useful for meteoland

Usage

reshapemeteospain(weather_data, output = "SpatialPointsMeteorology", 
                  proj4string = NULL, complete = TRUE,
                  verbose = TRUE)
reshapeworldmet(hourly_data, output = "SpatialPointsMeteorology", 
                proj4string = NULL, complete = TRUE,
                verbose = TRUE)
reshapeweathercan(hourly_data, daily_data = NULL, output = "SpatialPointsMeteorology",
                  proj4string = NULL, complete = TRUE, verbose = TRUE)

Value

An object of the class indicated in output.

Arguments

weather_data

Hourly or daily weather data, in form of an sf (spatial) object, obtained using function 'get_meteo_from()' in package 'meteospain'.

hourly_data

Hourly weather data. In the case of reshapeworldmet, a tibble or data frame returned by function 'importNOAA'. In the case of reshapeweathercan, a tibble or data frame returned by function 'weather_dl' with 'interval="hour"'.

daily_data

Daily weather data (only for reshapeweathercan), a tibble or data frame returned by function 'weather_dl' with 'interval="day"'.

output

Kind of output desired. Either 'SpatialPointsTopography', 'SpatialPointsMeteorology' or 'MeteorologyInterpolationData'.

proj4string

A string or CRS to change the coordinate reference system of the output. If NULL the spatial reference will be geographic coordinates (i.e. CRS("+proj=longlat")). When reshaping to MeteorologyInterpolationData it is recommended to use a reference system with meters in units, such as UTM.

complete

A flag to indicate that missing variables should be completed using function meteocomplete

verbose

A flag to show information of the reshape process in the console output.

Author

Miquel De Cáceres Ainsa, CREAF

Details

Note that to have precipitation included in downloads from 'worldmet' you should set 'precip = TRUE' when calling function 'importNOAA'. In the case of weathercan, precipitation is only provided for daily data (i.e. setting 'interval="day"' when calling 'weather_dl'), whereas wind speed and relative humidity are only availave for hourly data (i.e., setting 'interval="hour"' when calling 'weather_dl'). Hence, in meteoland we recommend downloading both daily and hourly data and then calling function reshapeweathercan to merge the two sources.

See Also

meteocomplete