Spatial Analysis

23
Spatial Analysis Maps, Points, and Grid Counts

description

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. - PowerPoint PPT Presentation

Transcript of Spatial Analysis

Page 1: Spatial  Analysis

Spatial Analysis

Maps, Points, and Grid Counts

Page 2: Spatial  Analysis

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

Page 3: Spatial  Analysis

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

Page 4: Spatial  Analysis

# 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")

Page 5: Spatial  Analysis
Page 6: Spatial  Analysis
Page 7: Spatial  Analysis
Page 8: Spatial  Analysis

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

Page 9: Spatial  Analysis

# 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)

Page 10: Spatial  Analysis
Page 11: Spatial  Analysis

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")

Page 12: Spatial  Analysis
Page 13: Spatial  Analysis
Page 14: Spatial  Analysis

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")

Page 15: Spatial  Analysis
Page 16: Spatial  Analysis

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

Page 17: Spatial  Analysis

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

Page 18: Spatial  Analysis

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")

Page 19: Spatial  Analysis
Page 20: Spatial  Analysis

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

Page 21: Spatial  Analysis

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)

Page 22: Spatial  Analysis
Page 23: Spatial  Analysis