In this document we compute several 3d stats with the package spatstat https://www.rdocumentation.org/packages/spatstat/versions/1.49-0 including the Pair Correlation Function of a Three-Dimensional Point Pattern https://www.rdocumentation.org/packages/spatstat/versions/1.49-0/topics/pcf3est function, the K-function of a Three-Dimensional Point Pattern https://www.rdocumentation.org/packages/spatstat/versions/1.49-0/topics/K3est, the Empty Space Function of a Three-Dimensional Point Pattern https://www.rdocumentation.org/packages/spatstat/versions/1.49-0/topics/F3est and the Nearest Neighbour Distance Distribution Function of a Three-Dimensional Point Pattern https://www.rdocumentation.org/packages/spatstat/versions/1.49-0/topics/G3est.

First we load the required libraries

require(spatstat)
## Loading required package: spatstat
## Loading required package: nlme
## Loading required package: rpart
## 
## spatstat 1.49-0       (nickname: 'So-Called Software') 
## For an introduction to spatstat, type 'beginner'
## 
## Note: spatstat version 1.49-0 is out of date by more than 13 weeks; a newer version should be available.

We’re ready to load the files with coordinates

sh1<-read.csv("suelo_h1.csv",header=FALSE)
sh2<-read.csv("suelo_h2.csv",header=FALSE)
sh3<-read.csv("suelo_h3.csv",header=FALSE)
sh4<-read.csv("suelo_h4.csv",header=FALSE)
suh<-rbind(sh1,sh2,sh3,sh4)

Once libraries are files are in place, we can subset the files.

We begin with the faunal remains and LAYER H1

fauh<-subset(suh,suh[,6]==1)
fauh3d<-pp3(fauh[,2],fauh[,3],fauh[,4],box3(c(999,1004),c(995,999),c(407,408)))
plot.pp3(fauh3d, main="Faunal remains")

FAUNAL REMAINS 3D DENSITY KERNEL FORTEA’S LAYER h

par(mfrow=c(2,2))

K-function of a Three-Dimensional Point Pattern

k3<-K3est(fauh3d)
plot(k3)

Nearest Neighbour Distance Distribution Function of a Three-Dimensional Point Pattern

g3<-G3est(fauh3d)
plot(g3)

Empty Space Function of a Three-Dimensional Point Pattern

j3<-F3est(fauh3d)
plot(j3)

Pair Correlation Function of a Three-Dimensional Point Pattern

p3<-pcf3est(fauh3d)
plot(p3)

POTTERY FORTEA’S LAYER h

fauh<-subset(suh,suh[,6]==2)
fauh3d<-pp3(fauh[,2],fauh[,3],fauh[,4],box3(c(999,1004),c(995,999),c(407,408)))
plot.pp3(fauh3d,main="Pottery")

par(mfrow=c(2,2))

K-function of a Three-Dimensional Point Pattern

k3<-K3est(fauh3d)
plot(k3)

Nearest Neighbour Distance Distribution Function of a Three-Dimensional Point Pattern

g3<-G3est(fauh3d)
plot(g3)

Empty Space Function of a Three-Dimensional Point Pattern

j3<-F3est(fauh3d)
plot(j3)

Pair Correlation Function of a Three-Dimensional Point Pattern

p3<-pcf3est(fauh3d)
plot(p3)

FLINT FORTEA’S LAYER h

fauh<-subset(suh,suh[,6]==3)
fauh3d<-pp3(fauh[,2],fauh[,3],fauh[,4],box3(c(999,1004),c(995,999),c(407,408)))
plot.pp3(fauh3d,main="Lithics")

par(mfrow=c(2,2))

K-function of a Three-Dimensional Point Pattern

k3<-K3est(fauh3d)
plot(k3)

Nearest Neighbour Distance Distribution Function of a Three-Dimensional Point Pattern

g3<-G3est(fauh3d)
plot(g3)

Empty Space Function of a Three-Dimensional Point Pattern

j3<-F3est(fauh3d)
plot(j3)

Pair Correlation Function of a Three-Dimensional Point Pattern

p3<-pcf3est(fauh3d)
plot(p3)

MOLLUSCS FORTEA’S LAYER h

fauh<-subset(suh,suh[,6]==4)
fauh3d<-pp3(fauh[,2],fauh[,3],fauh[,4],box3(c(999,1004),c(995,999),c(407,408)))
plot.pp3(fauh3d,main="Molluscs")

par(mfrow=c(2,2))

K-function of a Three-Dimensional Point Pattern

k3<-K3est(fauh3d)
plot(k3)

Nearest Neighbour Distance Distribution Function of a Three-Dimensional Point Pattern

g3<-G3est(fauh3d)
plot(g3)

Empty Space Function of a Three-Dimensional Point Pattern

j3<-F3est(fauh3d)
plot(j3)

Pair Correlation Function of a Three-Dimensional Point Pattern

p3<-pcf3est(fauh3d)
plot(p3)

THAT’S ALL FOLKS