1 / 23

Spatial Analysis

Spatial Analysis. Maps, Points, and Grid Counts. Maps in R. Simple maps and profiles can be constructed using basic R functions Basic uses Grid map with values in each square Piece-plot map of artifacts Piece-plot profile Contour map (and filled contour) 3d perspective map. Grid Map.

misha
Download Presentation

Spatial Analysis

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Spatial Analysis Maps, Points, and Grid Counts

  2. Maps in R • Simple maps and profiles can be constructed using basic R functions • Basic uses • Grid map with values in each square • Piece-plot map of artifacts • Piece-plot profile • Contour map (and filled contour) • 3d perspective map

  3. Grid Map • Use windows() to set size • Use plot() function with asp=1 and optionally, axes=FALSE • Use polygons() or lines() to identify excavation units • Use text() to print information

  4. # Open Debitage3a # Open script file Grid3a.R and run it Grid3a() text(Debitage3a$East, Debitage3a$North, Debitage3a$TCt) text(985, 1015.5, "Debitage Count") Grid3a(FALSE) text(Debitage3a$East, Debitage3a$North, round(Debitage3a$TWgt,0)) text(985, 1015.5, "Debitage Weight")

  5. Piece-Plot Map • Use windows() to set size • Use plot() function with asp=1 and optionally, axes=FALSE • Use polygons() or lines() to identify excavation units • Use points() to add piece-plotted artifacts

  6. # Open BTF3a Grid3a() color <- c("red", "blue", "green") points(BTF3a[,1:2], pch=20, col=color[as.numeric(BTF3a$Type)]) text(985, 1015.6, "Bifacial Thinning Flakes") legend(986, 1022, c("Fragment", "Cortex", "No Cortex"), pch=20, col=color)

  7. library(vegan) CBTmst <- spantree(dist(BTF3a[BTF3a$Type=="CBT",1:2])) summary(CBTmst$dist) Grid3a(FALSE) points(BTF3a[BTF3a$Type=="CBT",1:2], pch=20) lines(CBTmst, BTF3a[BTF3a$Type=="CBT",1:2]) text(985, 1015.6, "Cortical Bifacial Thinning Flakes") # Min. 1st Qu. Median Mean 3rd Qu. Max. # 0.03606 0.12200 0.20010 0.28680 0.29080 1.16200 CBTmst2 <- spantree(dist(BTF3a[BTF3a$Type=="CBT",1:2]), toolong=.3) Grid3a(FALSE) points(BTF3a[BTF3a$Type=="CBT",1:2], pch=20) lines(CBTmst2, BTF3a[BTF3a$Type=="CBT",1:2]) text(985, 1015.6, "Cortical Bifacial Thinning Flakes")

  8. library(grDevices) Grid3a() BTFr3a <- BTF3a[BTF3a$Type=="BTF",] points(BTFr3a[,1:2], pch=20, col="red") BTFrch <- chull(BTFr3a[,1:2]) polygon(BTFr3a$East[BTFrch], BTFr3a$North[BTFrch], border="red") CBT3a <- BTF3a[BTF3a$Type=="CBT",] points(CBT3a[,1:2], pch=20, col="blue") CBTch <- chull(CBT3a[,1:2]) polygon(CBT3a$East[CBTch], CBT3a$North[CBTch], border="blue") NCBT3a <- BTF3a[BTF3a$Type=="NCBT",] points(NCBT3a[,1:2], pch=20, col="green") NCBTch <- chull(NCBT3a[,1:2]) polygon(NCBT3a$East[NCBTch], NCBT3a$North[NCBTch], border="green")

  9. Piece-Plot Profile • Use windows() to set the graph window proportions • Use plot() but NOT asp=1 to exaggerate the vertical dimension • For north/south profiles select points within one meter East • For east/west profiles select points within one meter north

  10. Contour Map • Use kde2d() to construct a kernel density map for north and east • Use contour to plot the map • Can adjust bandwidth values to increase or decrease smoothing

  11. Grid3a(FALSE) BTFdensity <- kde2d(BTF3a$East, BTF3a$North, n=100, lims=c(982,987,1015,1022)) contour(BTFdensity,xlim=c(982,987), ylim=c(1015,1022), add=TRUE) text(985, 1015.6, "Bifacial Thinning Flakes")

  12. 3d Perspective Map • Not terribly useful but fun to look at • Cannot add grid to map or other labeling • Fiddle with expand=, theta=, and phi= options to get the best view

  13. BTFdensity <- kde2d(BTF3a$East, BTF3a$North, n=100, lims=c(982,987,1015,1022)) persp(BTFdensity,xlim=c(982,987),ylim=c(1015,1022), main="Bifacial Thinning Flakes", scale=FALSE, xlab="East", ylab="North", zlab="Density", theta=-30, phi=25, expand=5) persp(BTFdensity,xlim=c(982,987),ylim=c(1015,1022), main="Bifacial Thinning Flakes", scale=FALSE, xlab="East", ylab="North", zlab="Density", theta=-30, phi=40, expand=5)

More Related