image.SpatialGridDataFrame        package:sp        R Documentation

_i_m_a_g_e _g_r_i_d_d_e_d _s_p_a_t_i_a_l _d_a_t_a, _o_r _c_o_n_v_e_r_t _t_o _f_o_r_m_a_t _f_o_r _i_m_a_g_e

_D_e_s_c_r_i_p_t_i_o_n:

     Convert gridded data in SpatialGridDataFrame to image format; call
     image on data in SpatialGridDataFrame format

_U_s_a_g_e:

     image.SpatialGridDataFrame(x, attr = 1, xcol = 1, ycol = 2, asp = 1, axes = FALSE, ...)
     as.image.SpatialGridDataFrame(x, xcol = 1, ycol = 2)

_A_r_g_u_m_e_n_t_s:

       x: object of class SpatialGridDataFrame 

    attr: column number of attribute variable; this may be the column
          name in the data.frame of 'data' (as.data.frame(data)), or a
          column number 

    xcol: column number of x-coordinate, in the coordinate matrix 

    ycol: column number of y-coordinate, in the coordinate matrix 

     asp: aspect ratio of unit x and unit y axis 

    axes: logical; should coordinate axes be drawn? 

     ...: arguments passed to image, see examples 

_V_a_l_u_e:

     'as.image.SpatialGridDataFrame' returns the list with elements 'x'
     and 'y', containing the coordinates of the cell centres of a
     matrix 'z', containing the attribute values in matrix form as
     needed by image.

_N_o_t_e:

     Providing 'xcol' and 'ycol' attributes seems obsolete, and it is
     for 2D data, but it may provide opportunities for plotting certain
     slices in 3D data. I haven't given this much thought yet.

     filled.contour seems to misinterpret the coordinate values, if we
     take the image.default manual page as the reference.

_A_u_t_h_o_r(_s):

     Edzer J. Pebesma

_R_e_f_e_r_e_n_c_e_s:

_S_e_e _A_l_s_o:

     image.default, SpatialGridDataFrame-class, levelplot in package
     'lattice'

_E_x_a_m_p_l_e_s:

     data(meuse.grid)
     coordinates(meuse.grid) = c("x", "y") # promote to SpatialPointsDataFrame
     gridded(meuse.grid) = TRUE            # promote to SpatialGridDataFrame
     image(meuse.grid["dist"], main = "Distance to river Meuse")
     data(meuse)
     coordinates(meuse) = c("x", "y")
     points(coordinates(meuse), pch = "+")

