meteo2STFDF: Create an object of STFDF class from two data frames...

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/meteo2STFDF.R

Description

The function creates an object of STFDF class, spatio-temporal data with full space-time grid, from two data frames (observation and stations). Observations data frame minimum contains station ID column, time column (day of observation) and measured variable column. Stations data frame contains at least station ID column, longitude (or x) and latitude (or y) column.

Usage

1
2
meteo2STFDF(obs, stations, obs.staid.time = c(1, 2), 
            stations.staid.lon.lat = c(1, 2, 3), crs=CRS(as.character(NA)), delta=NULL )

Arguments

obs

data.frame; observations data frame minimum contains station ID column, time column (day of observation) and measured variable column. It can contain additional variables (columns).

stations

data.frame; Stations data frame contains at least station ID column, longitude (or x) and latitude (or y) column.It can contain additional variables (columns).

obs.staid.time

numeric; records the column positions where in obs (observation) data frame the station ID and time values are stored.

stations.staid.lon.lat

numeric; records the column positions where in stations data frame the station ID, longitude (x) and latitude (y) values are stored.

crs

CRS; coordinate reference system (see CRS) of stations coordinates

delta

time; time interval to end points in seconds

Value

STFDF object

Note

The function is intended for conversion of meteorological data to STFDF object, but can be used for similar spatio temporal data stored in two separated tables.

Author(s)

Milan Kilibarda [email protected]

See Also

tgeom2STFDF pred.strk

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# prepare data
# load observation - data.frame of mean temperatures
data(dtempc) 
str(dtempc)
data(stations)
#
str(stations)
lonmin=18 ;lonmax=22.5 ; latmin=40 ;latmax=46
library(sp)
library(spacetime)
serbia = point.in.polygon(stations$lon, stations$lat, c(lonmin,lonmax,lonmax,lonmin), 
                          c(latmin,latmin,latmax,latmax))
st= stations[ serbia!=0, ] # stations in Serbia approx.
# create STFDF
temp <- meteo2STFDF(dtempc,st, crs= CRS('+proj=longlat +datum=WGS84'))
str(temp)

meteo documentation built on May 2, 2019, 3:29 p.m.