Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rm(list=ls())
- getwd()
- require("rgdal")
- RST <- readOGR(dsn = "ArcGIS//CRS//E_Umpqua_C_TA_shapefiles", layer =
- "range_town_clip",p4s = NULL, encoding = "ESRI Shapefile") #Read in
- #shapefile
- plot(RST) #Checking shapefile
- str(RST) #Shows the structure of shapefile
- slotNames(RST) #Gets slot names of shapefiles
- SelectRST <- as.data.frame(RST@data) #Creates a dataframe from the data slot
- SelectedRST <- SelectRST[sample(nrow(SelectRST), 100), ] #Selects 100 random
- #records from SelectRST
- RST.List <- as.list(rownames(SelectedRST)) #Creates a list of row numbers
- #for the randomly selected records
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement