Debian Codegraph @

man/gridded-methods.Rd

raw
1 \name{gridded-methods}
2 \docType{methods}
3 \alias{gridded-methods}
4 \alias{gridparameters}
5 \alias{fullgrid}
6 \alias{fullgrid,Spatial-method}
7 \alias{gridded}
8 \alias{gridded,Spatial-method}
9 \alias{fullgrid<-}
10 \alias{gridded<-}
11 \alias{fullgrid<-,Spatial,ANY-method}
12 \alias{fullgrid<-,SpatialGrid,logical-method}
13 \alias{fullgrid<-,SpatialGridDataFrame,logical-method}
14 \alias{fullgrid<-,SpatialPixels,logical-method}
15 \alias{fullgrid<-,SpatialPixelsDataFrame,logical-method}
16 \alias{gridded<-,SpatialGrid,logical-method}
17 \alias{gridded<-,SpatialGridDataFrame,logical-method}
18 \alias{gridded<-,SpatialPixels,logical-method}
19 \alias{gridded<-,SpatialPixelsDataFrame,logical-method}
20 \alias{gridded<-,SpatialPoints,list-method}
21 \alias{gridded<-,SpatialPoints,logical-method}
22 \alias{gridded<-,SpatialPointsDataFrame,list-method}
23 \alias{gridded<-,SpatialPointsDataFrame,logical-method}
24 \alias{gridded<-,data.frame,GridTopology-method}
25 \alias{gridded<-,data.frame,character-method}
26 \alias{gridded<-,data.frame,formula-method}
27
28 \title{ specify spatial data as being gridded, or find out whether they are }
29 \description{
30 returns logical (TRUE or FALSE) telling whether the object is gridded
31 or not; in assignment promotes a non-gridded structure to a gridded
32 one, or demotes a gridded structure back to a non-structured one.
33 }
34 \usage{
35 gridded(obj)
36 gridded(obj) <- value
37 fullgrid(obj)
38 fullgrid(obj) <- value
39 gridparameters(obj)
40 }
41 \arguments{
42 \item{obj}{ object deriving from class "Spatial" (for gridded), or
43 object of class \link{SpatialGridDataFrame-class} (for fullgrid and gridparameters)}
44 \item{value}{logical replacement values, TRUE or FALSE}
45 }
46 \section{Methods}{
47 \describe{
48 \item{obj = "Spatial"}{ object deriving from class "Spatial" }
49 }}
50 \value{ if obj derives from class Spatial, gridded(object) will tell
51 whether it is has topology on a regular grid; if assigned TRUE, if the
52 object derives from SpatialPoints and has gridded topology,
53 grid topology will be added to object, and the class of the object
54 will be promoted to \link{SpatialGrid-class} or
55 \link{SpatialGridDataFrame-class}
56
57 \code{fullgrid} returns a logical, telling whether the grid is full
58 and ordered (i.e., in full matrix form), or whether it is not full
59 or unordered (i.e. a list of points that happen to lie on a grid. If
60 assigned, the way the points are stored may be changed. Changing a set
61 of points to full matrix form and back may change the original order of
62 the points, and will remove duplicate points if they were present.
63
64 \code{gridparameters} returns, if \code{obj} inherits from
65 SpatialGridDataFrame its grid parameters, else it returns numeric(0). The
66 returned value is a data.frame with three columns, named cellcentre.offset
67 ("lower left cell centre coordinates"), cellsize, and cells.dim (cell
68 dimension); the rows correspond to the spatial dimensions.
69
70 }
71 \keyword{methods}
72 \examples{
73 # just 9 points on a grid:
74 x <- c(1,1,1,2,2,2,3,3,3)
75 y <- c(1,2,3,1,2,3,1,2,3)
76 xy <- cbind(x,y)
77 S <- SpatialPoints(xy)
78 class(S)
79 plot(S)
80 gridded(S) <- TRUE
81 gridded(S)
82 class(S)
83 summary(S)
84 plot(S)
85 gridded(S) <- FALSE
86 gridded(S)
87 class(S)
88
89 # data.frame
90 data(meuse.grid)
91 coordinates(meuse.grid) <- ~x+y
92 gridded(meuse.grid) <- TRUE
93 plot(meuse.grid) # not much good
94 summary(meuse.grid)
95
96 }
97 \keyword{spatial}