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)

