Function interpolation.coverage calculates, for each meteorological variable, the number of stations with data per date or the number of dates with data per station in an object of class MeteorologyInterpolationData-class.

interpolation.coverage(object, type = "spatial", percent = FALSE)

Arguments

object

An object of class MeteorologyInterpolationData-class.

type

A string with the coverage summary to be produced (either "spatial" or "temporal").

percent

A boolean flag to indicate that percentages should be returned instead of counts.

Value

If type = "spatial" the function returns an object of class SpatialPointsDataFrame with the number (or percentage) of dates with data per station and meteorological variable. If type = "temporal" the function returns an object of class data.frame with the number (or percentage) of stations with data per day and meteorological variable.

References

De Caceres M, Martin-StPaul N, Turco M, Cabon A, Granda V (2018) Estimating daily meteorological data and downscaling climate models over landscapes. Environmental Modelling and Software 108: 186-196.

Author

Miquel De Cáceres Ainsa, CREAF

Examples

data(exampleinterpolationdata)

#Number of days with data per station
head(interpolation.coverage(exampleinterpolationdata))
#>          coordinates MinTemperature MaxTemperature Precipitation
#> C7 (347104, 4614634)           1456           1454          1456
#> C8 (358240, 4615380)           1450           1449          1450
#> CA (382829, 4645816)           1444           1444          1444
#> VD (350600, 4616925)           1461           1461          1461
#> VP (377232, 4628439)           1461           1461          1461
#> W5 (360730, 4659875)           1288           1288          1288
#>    RelativeHumidity Radiation WindSpeed WindDirection
#> C7                0         0         0             0
#> C8                0         0         0             0
#> CA                0         0         0             0
#> VD                0         0         0             0
#> VP                0         0         0             0
#> W5                0         0         0             0

#Number of stations with data per day
head(interpolation.coverage(exampleinterpolationdata, type = "temporal"))
#>            MinTemperature MaxTemperature Precipitation RelativeHumidity
#> 2000-01-01             13             13            14                1
#> 2000-01-02             13             13            14                1
#> 2000-01-03             13             13            14                1
#> 2000-01-04             13             13            14                1
#> 2000-01-05             13             13            14                1
#> 2000-01-06             13             13            14                1
#>            Radiation WindSpeed WindDirection
#> 2000-01-01         0         1             1
#> 2000-01-02         0         1             1
#> 2000-01-03         0         1             1
#> 2000-01-04         0         1             1
#> 2000-01-05         0         1             1
#> 2000-01-06         0         1             1