Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. rm(list=ls())
  2. getwd()
  3. require("rgdal")
  4.  
  5. RST <- readOGR(dsn = "ArcGIS//CRS//E_Umpqua_C_TA_shapefiles", layer =
  6. "range_town_clip",p4s = NULL, encoding = "ESRI Shapefile") #Read in
  7. #shapefile
  8. plot(RST) #Checking shapefile
  9. str(RST) #Shows the structure of shapefile
  10. slotNames(RST) #Gets slot names of shapefiles
  11.  
  12. SelectRST <- as.data.frame(RST@data) #Creates a dataframe from the data slot
  13. SelectedRST <- SelectRST[sample(nrow(SelectRST), 100), ] #Selects 100 random
  14. #records from SelectRST
  15. RST.List <- as.list(rownames(SelectedRST)) #Creates a list of row numbers
  16. #for the randomly selected records
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement