wheat                 package:spdep                 R Documentation

_M_e_r_c_e_r _a_n_d _H_a_l_l _w_h_e_a_t _y_i_e_l_d _d_a_t_a

_D_e_s_c_r_i_p_t_i_o_n:

     Mercer and Hall wheat yield data, based on version in Cressie
     (1993), p. 455.

_U_s_a_g_e:

     data(wheat)

_F_o_r_m_a_t:

     The format of the object generated by running 'data(wheat)' is a
     three column data frame made available by Hongfei Li. The example
     section shows how to convert this to the object used in
     demonstrating the 'aple' function, and is a: Formal class
     'SpatialPolygonsDataFrame' [package "sp"] with 5 slots; the data
     slot is a data frame with 500 observations on the following 6
     variables.

     '_l_a_t' local coordinates northings ordered north to south

     '_y_i_e_l_d' Mercer and Hall wheat yield data

     '_r' rows south to north; levels in distance units of plot centres

     '_c' columns west to east; levels in distance units of plot centres

     '_l_o_n' local coordinates eastings

     '_l_a_t_1' local coordinates northings ordered south to north

_S_o_u_r_c_e:

     Cressie, N. A. C. (1993) Statistics for Spatial Data. Wiley, New
     York, p. 455.

_R_e_f_e_r_e_n_c_e_s:

     Mercer, W. B. and Hall, A. D. (1911) The experimental error of
     field trials. Journal of Agricultural Science 4, 107-132.

_E_x_a_m_p_l_e_s:

     ## Not run: 
     data(wheat)
     names(wheat) <- c('lon','lat','yield')
     wheat$lat1 <- 69 - wheat$lat
     wheat$r <- factor(wheat$lat1)
     wheat$c <- factor(wheat$lon)
     wheat_sp <- wheat
     coordinates(wheat_sp) <- c("lon", "lat1")
     wheat_spg <- wheat_sp
     gridded(wheat_spg) <- TRUE
     wheat_spl <- as(wheat_spg, "SpatialPolygons")
     df <- as(wheat_spg, "data.frame")
     row.names(df) <- sapply(slot(wheat_spl, "polygons"),
      function(x) slot(x, "ID"))
     wheat <- SpatialPolygonsDataFrame(wheat_spl, data=df)
     ## End(Not run)
     wheat <- readShapeSpatial(system.file("etc/shapes/wheat.shp",
      package="spdep")[1])

