File: RFsp-class.Rd

package info (click to toggle)
r-cran-randomfields 3.3.14-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,916 kB
  • sloc: cpp: 52,159; ansic: 3,015; makefile: 2; sh: 1
file content (167 lines) | stat: -rw-r--r-- 6,041 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
\name{RFsp-class}
\docType{class}
\alias{RFsp-class}
\alias{RFspatialDataFrame}
\alias{RFdataFrame}
%% S4 methods
\alias{summary,RFsp-method}
\alias{variance,RFsp-method}
\alias{dimensions,RFsp-method}
\alias{dimensions,RFdataFrame-method}
\alias{dimensions,RFspatialDataFrame-method}
%\alias{isGridded}
%\alias{isGridded,RFsp-method}
\alias{RFspDataFrame2conventional}
\alias{RFspDataFrame2conventional,RFsp-method}
\alias{RFspDataFrame2dataArray}
\alias{RFspDataFrame2dataArray,RFsp-method}
\alias{[,RFsp-method}
\alias{[,RFsp,ANY,ANY-method}
\alias{[,RFsp,ANY,ANY,ANY-method}
\alias{[<-,RFsp-method}
\alias{[<-,RFsp,ANY,ANY-method}
\alias{[<-,RFsp,ANY,ANY,ANY-method}
\alias{RFspatialDataFrame-class}
\alias{RFspatialDataFrame}
\alias{RFdataFrame-class}
\alias{RFdataFrame}

\title{Class \code{RFsp}}

\description{ \code{"RFsp"} is a virtual class which contains the four classes
 \command{\link[=RFspatialGridDataFrame-class]{RFspatialGridDataFrame}} 
 (data on a full grid and \eqn{space-time-dimension \ge
 2}{space-time-dimension > 2}), 
 \command{\link[=RFspatialPointsDataFrame-class]{RFspatialPointsDataFrame}}
 (data not on a grid and \eqn{space-time-dimension \ge
 2}{space-time-dimension > 2}), 
 \command{\link[=RFgridDataFrame-class]{RFgridDataFrame}}
 (data on a full grid and \eqn{space-time-dimension = 1}), 
 \command{\link[=RFpointsDataFrame-class]{RFpointsDataFrame}}
 (data not on a grid and \eqn{space-time-dimension = 1})


 The first two subclasses are summarized in
 \code{"RFspatialDataFrame"} whilst the latter two are
 summarized in \code{"RFdataFrame"}.
 
% The first two classes are summarized in the class
% \code{RFspatialDataFrame} the last two classes in the class
%\code{ RFdataFrame}.
 
}

\section{Objects from the Class}{
 are never to be generated; only derived classes can be meaningful. }

%\section{Slots}{
% \describe{
% only for sub-classes
% \command{\link[=RFspatialGridDataFrame-class]{RFspatialGridDataFram%e}}
% and \command{\link[=RFspatialPointsDataFrame-class]{RFspatialPoints%DataFrame}}:
% \item{\code{bbox}:}{Object of class \code{"matrix"}; 2-column matrix
%	holding the minimum in first and maximum in second column for the
%	x-coordinate (first row), y-coordinate (second row) and optionally,
%	for points and grids only, further coordinates. The constructed 
%	Spatial object will be invalid if any bbox values are NA or
%	infinite. The column names must be \code{c("min", "max")}} 
 % \item{\code{proj4string}:}{Object of class \code{"CRS"};
%	holding a valid proj4 string, which can be used for unprojecting
%	or reprojecting coordinates; it is initialised to NA. Other strings
%	are checked for validity in the rgdal package, but attempts to
%	assign a string containing \dQuote{longlat} to data extending beyond
%	longitude [-180, 360] or lattitude [-90, 90] will be stopped. }
% }
%}
\section{Methods}{
 \describe{
% \item{bbox}{\code{signature(obj = "Spatial")}: retrieves the bbox element }
\item{summary}{\code{signature(obj = "RFsp")}: returns a summary of the
 object; uses or imitates summary method of class
 \code{\link[sp:Spatial-class]{Spatial}} from the \pkg{sp}-package}
\item{dimensions}{\code{signature(obj = "RFsp")}: retrieves the number
 of spatial or spatio-temporal dimensions spanned }
%\item{isGridded}{\code{signature(obj = "RFsp")}: logical, tells whether
%  the data is on a regular spatial grid }
\item{RFspDataFrame2dataArray}{\code{signature(obj = "RFsp")}:
  transforms \code{RFsp} objects to array
}
\item{RFspDataFrame2conventional}{\code{signature(obj = "RFsp")}:
  transforms \code{RFsp} objects to a list with additional information
}
\item{[}{\code{signature(obj = "RFsp")}: selects columns of the
 \code{data}-slot, while all other slots are kept unmodified}
\item{[<-}{\code{signature(obj = "RFsp")}: replaces columns of the
 \code{data}-slot, while all other slots are kept unmodified}
% \item{plot}{\code{signature(x = "Spatial", y = "missing")}: plot method
%	for spatial objects; does nothing but setting up a plotting region choosing
%	a suitable aspect if not given(see below), colouring the plot background using either a bg= argument or par("bg"), and possibly drawing axes. }
\item{variance}{\code{signature(object = "RFsp")}: returns the kriging
 variance if available}
 }
}

%\usage{
%Spatial(bbox, proj4string = CRS(as.character(NA)))
%}

%\arguments{
%\item{bbox}{a bounding box matrix}
%\item{proj4string}{a CRS object}
%}

\author{Alexander Malinowski; \martin}


\section{Warning }{This class is not useful itself, but the above
 mentioned classes in this package derived from it. }

\seealso{
 \command{\link[=RFspatialGridDataFrame-class]{RFspatialGridDataFrame}},
 \command{\link[=RFspatialPointsDataFrame-class]{RFspatialPointsDataFrame}},
 \command{\link[=RFgridDataFrame-class]{RFgridDataFrame}},
 \command{\link[=RFpointsDataFrame-class]{RFpointsDataFrame}},
 \command{\link{sp2RF}}
}

\examples{\dontshow{StartExample()}
RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
##                   RFoptions(seed=NA) to make them all random again

## Generating an object of class "RFspatialGridDataFrame"
## and one of class "RFspatialPointsDataFrame".

model <- RMcauchy(gamma=4, var=0.1, scale=2)
x <- seq(0,10,len=100)
r <- cbind(runif(100, min=1, max=9),runif(100, min=1, max=9))

z1 <- RFsimulate(model=model, x=x, y=x, n=4)
z2 <- RFsimulate(model=model, x=r, n=2)

## Applying available functions.

class(z1)
class(z2)
summary(z1)
summary(z2)
plot(z1)
plot(z2)
%isGridded(z1) ## TRUE
%isGridded(z2) ## FALSE

z4 <- RFspDataFrame2conventional(z2)
str(z2)
str(z4)

dta <- data.frame(coords=z4$x,data=z2@data[,1])
z3<-RFinterpolate(model=model, x=x, y=x, data=dta) 
plot(z3,z2)

## Illustrating the warning.

a1 <- new("RFpointsDataFrame")
str(a1)
try(a2 <- new("RFsp")) ## ERROR
\dontshow{FinalizeExample()}}

\keyword{classes}