gridded-methods              package:sp              R Documentation

_s_p_e_c_i_f_y _s_p_a_t_i_a_l _d_a_t_a _a_s _b_e_i_n_g _g_r_i_d_d_e_d, _o_r _f_i_n_d _o_u_t _w_h_e_t_h_e_r _t_h_e_y _a_r_e

_D_e_s_c_r_i_p_t_i_o_n:

     returns logical (TRUE or FALSE) telling whether the object is
     gridded or not; in assignment promotes a non-gridded structure to
     a gridded one, or demotes a gridded structure back to a
     non-structured one.

_U_s_a_g_e:

             gridded(obj)
             gridded(obj) <- TRUE
             fullgrid(obj)
             fullgrid(obj) <- TRUE
             gridparameters(obj)

_A_r_g_u_m_e_n_t_s:

     obj: object deriviving from class "Spatial" (for gridded), or 

     object of class SpatialGridDataFrame-class (for fullgrid and
     gridparameters)

_V_a_l_u_e:

     if obj derives from class Spatial, gridded(object) will tell
     whether it is has topology on a regular grid; if assigned TRUE, if
     the object derives from SpatialPoints and has gridded topology,
     grid topology will be added to object, and the class of the object
     will be promoted to SpatialGrid-class or 
     SpatialGridDataFrame-class

     'fullgrid' returns a logical, telling whether the grid is full and
     ordered (i.e., in full matrix form), or whether it is not full or
     unordered (i.e. a list of points that happen to lie on a grid. If
     assigned, the way the points are stored may be changed. Changing a
     set of points to full matrix form and back may change the original
     order of the points, and will remove duplicate points if they were
     present.

     'gridparameters' returns, if 'obj' inherits from
     SpatialDataFrameGrid its grid parameters, else it returns
     numeric(0).  The returned value is a data.frame with three
     columns, named cellcentre.offset ("lower left cell centre
     coordinates"), cellsize, and cells.dim (cell dimension); the rows
     correspond to the spatial dimensions.

_M_e_t_h_o_d_s:

     _o_b_j = "_S_p_a_t_i_a_l" object deriviving from class "Spatial" 

_E_x_a_m_p_l_e_s:

     # just 9 points on a grid:
     x <- c(1,1,1,2,2,2,3,3,3)
     y <- c(1,2,3,1,2,3,1,2,3)
     xy <- cbind(x,y)
     S <- SpatialPoints(xy)
     class(S)
     plot(S)
     gridded(S) <- TRUE
     gridded(S)
     class(S)
     summary(S)
     plot(S)
     gridded(S) <- FALSE
     gridded(S)
     class(S)

     # data.frame
     data(meuse.grid)
     coordinates(meuse.grid) <- ~x+y
     gridded(meuse.grid) <- TRUE
     plot(meuse.grid) # not much good
     summary(meuse.grid)

