SpatialPointsDataFrame-class       package:sp       R Documentation

_C_l_a_s_s "_S_p_a_t_i_a_l_P_o_i_n_t_s_D_a_t_a_F_r_a_m_e"

_D_e_s_c_r_i_p_t_i_o_n:

     Class for spatial attributes that have spatial point locations

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Objects can be created by calls of the form 'coordinates(x) =
     c("x", "y") '. or of the form 'coordinates(x) = xy'; see
     coordinates.

_S_l_o_t_s:

     '_d_a_t_a': Object of class AttributeList-class containing the
          attribute data (may or may not contain the coordinates in its
          columns) 

     '_c_o_o_r_d_s': Object of class '"matrix"'; the coordinates matrix
          (points are rows in the matrix) 

     '_c_o_o_r_d_s._s_t_r_i_p_p_e_d' Object of class logical; if TRUE, when the
          object was created the coordinates were retrieved from the
          data.frame, and hence stripped from it; after coercion to
          data.frame, e.g. by  as.data.frame(x), coordinates will again
          be added (as first few columns)  to the data.frame 

     '_b_b_o_x': Object of class '"matrix"'; bounding box

     '_p_r_o_j_4_s_t_r_i_n_g': Object of class '"CRS"'; projection string

_E_x_t_e_n_d_s:

     Class '"SpatialPoints"', directly. Class '"Spatial"', by class
     '"SpatialPoints"'.

_M_e_t_h_o_d_s:

     [ 'signature(x = "SpatialPointsDataFrame")': subset rows or
          columns; in case of row subsetting, the coordinates are also
          subsetted 

     _c_o_e_r_c_e 'signature(from = "SpatialPointsDataFrame", to =
          "data.frame")':      extracts the AttributeList part, and
          converts it to a data.frame 

     _c_o_e_r_c_e 'signature(from = "SpatialPointsDataFrame", to =
          "AttributeList")':      extracts the AttributeList part  

     _c_o_o_r_d_i_n_a_t_e_s 'signature(obj = "SpatialPointsDataFrame")': retrieves
          the coordinates only 

     _s_h_o_w 'signature(object = "SpatialPointsDataFrame")': print method 

     _p_l_o_t 'signature(x = "SpatialPointsDataFrame")': plot points

     _p_o_i_n_t_s 'signature(x = "SpatialPointsDataFrame")': add points to
          plot

_N_o_t_e:

_A_u_t_h_o_r(_s):

     Edzer J. Pebesma, e.pebesma@geo.uu.nl

_R_e_f_e_r_e_n_c_e_s:

_S_e_e _A_l_s_o:

     'coordinates', 'SpatialPoints-class'

_E_x_a_m_p_l_e_s:

     data(meuse)
     xy = meuse[c("x", "y")] # retrieve coordinates as data.frame
     class(meuse)
     data(meuse) # reload data.frame
     coordinates(meuse) = c("x", "y") # specify column names
     class(meuse)
     data(meuse) # reload data.frame
     coordinates(meuse) = c(1, 2) # specify column names
     class(meuse)
     data(meuse) # reload data.frame
     coordinates(meuse) = ~x+y # formula
     class(meuse)
     data(meuse) # reload data.frame
     coordinates(meuse) = xy   # as data frame
     class(meuse)
     data(meuse) # reload data.frame
     coordinates(meuse) = as.matrix(xy)   # as matrix
     meuse$log.zn = log(meuse$zinc)
     class(meuse)
     dim(meuse)

