# look at documentation of addDataValues. Import more than one location to execute the example.
# when you use getDataValues the method return an inherited_stfdf
example(addDataValues)
inDB = getDataValues()
# Select data
#You can selected the data by using numerics and characters.
#In the following code line 'inDB' is sub-setted to the
#second and third location, the first twenty dates and the temperature.
#Advice: The variable must have the correct term. For support
# look at the column name of inDB@data.
selectedData = inDB[1, 1:10, "Distance"]
#Furthermore you can miss out some parameters:
selectedData2 = inDB[1,10:10]
selectedData3 = inDB[,10:10]
#Attention: if the dataset contains only one location
#(or it is subset only one point) it's impossible
#to get a inherited spacetime-object. So you get a object of xts.
#If only one time is selected you get a SpatialPointsDataFrame.
#The inherited stfdf-data can visualized in different plots. For example:
stplot(inDB, mode='tp', type = 's')
stplot(inDB, mode='xt')
# Further you can access the slots of object by take advantage of the '@'.
inDB@Metadata
inDB@sp
inDB@time
inDB@data
Run the code above in your browser using DataLab