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)

