# read a vector representation of the `Farmsum' field (by means of rgdal-package)
shpFarmsum <- readOGR(dsn = system.file("maps", package = "spcosa"), layer = "farmsum")
# stratify `Farmsum' into 50 strata
myStratification <- stratify(shpFarmsum, nStrata = 50)
# sample two sampling units per stratum
mySamplingPattern <- spsample(myStratification, n = 2)
# plot the resulting sampling pattern
plot(myStratification, mySamplingPattern)Run the code above in your browser using DataLab