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, xlab, ylab, ...)
     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 

    xlab: label for x-axis 

    ylab: label for y-axis 

     ...: 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 = "+")

