coordinates                package:sp                R Documentation

_s_e_t_s _s_p_a_t_i_a_l _c_o_o_r_d_i_n_a_t_e_s _t_o _c_r_e_a_t_e _s_p_a_t_i_a_l _d_a_t_a, _o_r _r_e_t_r_i_e_v_e_s
_s_p_a_t_i_a_l _c_o_o_r_d_i_n_a_t_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     sets spatial coordinates to create spatial data, or retrieves
     spatial coordinates

_U_s_a_g_e:

             coordinates(obj)
             coordinates(object) <- value

_A_r_g_u_m_e_n_t_s:

     obj: object deriving from class "Spatial" 

  object: object of class "data.frame" 

   value: spatial coordinates; either a matrix, list, or data frame
          with numeric data, or column names, column number or a
          reference: a formula (in the form of e.g. '~x+y'), column
          numbers (e.g. 'c(1,2)') or column names (e.g. 'c("x","y")')
          specifying which columns in 'object' are the spatial
          coordinates. If the coordinates are part of object, giving
          the reference does not duplicate them, giving their value
          does duplicate them in the resulting structure. 

_V_a_l_u_e:

     an object of class SpatialPointsDataFrame

_E_x_a_m_p_l_e_s:

     # data.frame
     data(meuse.grid)
     coordinates(meuse.grid) <- ~x+y
     gridded(meuse.grid) <- TRUE
     bbox(meuse.grid)

