A field-based experiment was carried out to assess the impact of heat on lithic raw materials commonly used for knapping tools along the north Patagonian coast of Argentina. Descriptive data for the experimental items were recorded both before and after exposure to fire. Through network analysis, we explore the relationship between variables to establish the co-occurring of traits resulting from the material’s exposure to heat. Statistical analysis of network topology allows us to identify clusters of variables, which were categorized into morphological, mechanical, and pseudo-technological groups. These findings indicate that alterations within the same category covary more than those across different categories. The results obtained are relevant to addressing taphonomic issues in the northern coast of Patagonia, where frequent fire seasons affect surface sites. Ultimately, we aim to characterize these traits and build a reference framework to compare the transformations observed in the lithic archaeological record caused by natural fires.

#Packages
library(bootnet)
## Cargando paquete requerido: ggplot2
## This is bootnet 1.6
## For questions and issues, please see github.com/SachaEpskamp/bootnet.
library(qgraph)
library(igraph)
## Warning: package 'igraph' was built under R version 4.4.2
## 
## Adjuntando el paquete: 'igraph'
## The following objects are masked from 'package:stats':
## 
##     decompose, spectrum
## The following object is masked from 'package:base':
## 
##     union
library(ggplot2)
library(vegan)
## Cargando paquete requerido: permute
## 
## Adjuntando el paquete: 'permute'
## The following object is masked from 'package:igraph':
## 
##     permute
## Cargando paquete requerido: lattice
## This is vegan 2.6-8
## 
## Adjuntando el paquete: 'vegan'
## The following object is masked from 'package:igraph':
## 
##     diversity
library(reshape2)
library(dplyr)
## 
## Adjuntando el paquete: 'dplyr'
## The following objects are masked from 'package:igraph':
## 
##     as_data_frame, groups, union
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(vcdExtra)
## Cargando paquete requerido: vcd
## Cargando paquete requerido: grid
## Cargando paquete requerido: gnm
## 
## Adjuntando el paquete: 'gnm'
## The following object is masked from 'package:lattice':
## 
##     barley
## The following object is masked from 'package:igraph':
## 
##     gnm
## 
## Adjuntando el paquete: 'vcdExtra'
## The following object is masked from 'package:dplyr':
## 
##     summarise
library(jakR)
library(rstatix)
## 
## Adjuntando el paquete: 'rstatix'
## The following object is masked from 'package:stats':
## 
##     filter
library(changepoint)
## Warning: package 'changepoint' was built under R version 4.4.2
## Cargando paquete requerido: zoo
## 
## Adjuntando el paquete: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
## Successfully loaded changepoint package version 2.3
##  WARNING: From v.2.3 the default method in cpt.* functions has changed from AMOC to PELT.
##  See NEWS for details of all changes.
library(MASS) 
## 
## Adjuntando el paquete: 'MASS'
## The following object is masked from 'package:rstatix':
## 
##     select
## The following object is masked from 'package:dplyr':
## 
##     select
library(reshape2) 
#Datasets
Fire_Dat=read.table("FireDat2.txt", T) ##Experimental results traits, complete
Fire_Means=read.table("FireMeans.txt", T) ##Average measure of temperature for #each experiment
RawTraits2=read.table("RawMat_Traits.txt",T)#Traits for BA and VB only
Frag_Vol=read.table("Frag_Vol.txt",T)
print(Fire_Dat)
##     Col Lus IOx Disc Crac Craz Exf Soot Adh FlScar Scar Rip Bulb PI
## 1     1   0   0    1    1    1   1    1   0      1    0   0    0  0
## 2     1   0   1    1    0    0   0    0   0      0    0   0    0  0
## 3     1   1   1    1    1    1   0    1   1      1    0   0    1  0
## 4     1   1   1    1    1    1   0    1   1      0    0   0    1  1
## 5     1   0   1    1    0    0   0    0   1      0    0   0    0  0
## 6     1   1   1    1    0    0   0    0   0      0    0   0    0  0
## 7     1   1   1    1    1    1   1    1   1      0    1   0    1  1
## 8     1   1   0    1    1    1   0    1   1      0    0   0    0  0
## 9     1   1   0    0    1    1   0    1   1      1    1   0    0  0
## 10    1   1   0    1    0    1   0    1   1      1    1   0    0  0
## 11    1   1   0    1    1    1   0    1   1      1    0   0    0  0
## 12    1   1   0    1    1    1   0    1   1      0    0   0    0  0
## 13    1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 14    1   1   0    1    1    1   0    1   1      0    0   0    0  0
## 15    1   1   0    1    1    1   1    1   1      0    0   0    0  0
## 16    0   0   1    1    0    0   0    1   1      0    0   0    0  0
## 17    1   0   0    1    1    1   0    1   0      1    0   0    0  0
## 18    1   0   0    1    0    0   0    0   0      0    1   0    1  0
## 19    1   0   0    1    0    0   0    0   0      0    1   0    0  0
## 20    1   0   0    1    0    0   0    0   0      0    1   0    0  0
## 21    1   0   0    1    0    0   0    0   0      0    1   0    0  0
## 22    1   1   1    1    1    1   0    1   1      1    0   0    0  0
## 23    1   0   0    1    0    0   0    1   1      0    0   0    0  0
## 24    1   1   1    1    1    0   0    1   1      0    0   0    0  0
## 25    1   1   0    1    1    1   0    1   1      1    1   0    0  0
## 26    1   1   0    1    0    0   0    1   0      0    0   0    0  0
## 27    1   0   0    1    0    1   0    1   1      0    0   0    0  0
## 28    1   0   0    1    0    0   0    1   1      0    0   0    0  0
## 29    1   0   1    1    1    1   0    1   1      0    0   0    0  0
## 30    1   0   1    1    1    1   1    1   1      1    0   0    0  0
## 31    1   0   1    1    0    1   0    1   1      0    0   0    0  0
## 32    1   0   1    1    1    1   1    1   1      0    0   0    0  0
## 33    1   0   0    1    0    1   0    1   1      0    0   0    0  0
## 34    1   0   1    1    0    1   1    1   1      0    0   0    0  0
## 35    1   0   1    1    0    1   1    1   1      0    0   0    0  0
## 36    1   0   1    1    1    1   0    1   1      0    0   0    0  0
## 37    1   0   1    1    1    1   1    1   1      1    0   0    0  0
## 38    1   0   1    1    1    1   0    1   1      1    1   0    0  0
## 39    1   0   0    1    0    0   0    0   1      1    1   0    0  0
## 40    1   0   1    0    0    0   0    0   0      0    1   0    0  0
## 41    1   0   0    1    0    1   0    0   1      0    1   0    1  0
## 42    1   0   0    0    0    0   0    1   0      0    1   0    1  0
## 43    1   0   0    1    0    0   0    0   0      0    1   0    0  0
## 44    0   0   0    0    0    0   0    0   0      0    1   0    0  0
## 45    1   0   0    1    0    0   0    1   1      0    0   0    0  0
## 46    1   0   0    1    0    0   0    0   1      0    0   0    0  0
## 47    0   0   0    0    0    0   0    1   0      0    0   0    0  0
## 48    1   0   1    1    0    1   1    1   1      1    0   0    0  0
## 49    1   0   1    1    0    1   0    1   1      0    1   0    0  0
## 50    1   0   0    1    0    0   0    0   1      0    1   0    0  0
## 51    1   0   0    0    0    0   0    1   0      0    0   0    0  0
## 52    1   0   1    1    1    1   0    1   1      1    1   0    0  1
## 53    1   0   1    1    1    1   0    1   1      0    1   0    1  0
## 54    1   1   1    1    0    0   0    1   1      0    1   0    0  1
## 55    1   0   0    1    0    0   0    1   1      0    1   0    0  0
## 56    1   1   1    1    0    0   0    1   1      0    1   0    0  0
## 57    1   1   1    1    0    0   0    1   1      0    1   0    0  0
## 58    1   1   1    1    0    0   0    1   1      0    1   0    1  0
## 59    1   1   1    1    0    1   0    1   1      1    1   0    1  0
## 60    1   1   1    1    0    1   0    1   1      0    1   1    1  1
## 61    1   1   1    1    1    1   1    1   1      1    1   0    1  1
## 62    1   1   1    1    1    1   1    1   1      1    1   0    1  1
## 63    1   1   0    0    0    0   0    1   0      0    1   1    0  0
## 64    1   1   0    0    0    0   0    1   0      0    1   0    0  0
## 65    1   1   0    0    0    0   0    1   0      1    1   1    1  1
## 66    1   1   1    1    0    0   0    0   1      0    1   0    1  0
## 67    1   1   0    1    0    0   0    0   0      0    1   1    1  1
## 68    1   0   1    1    1    1   1    1   1      1    0   0    0  0
## 69    1   0   1    1    0    0   0    0   1      0    1   1    1  1
## 70    1   1   1    1    0    0   0    1   1      0    1   0    1  1
## 71    1   1   1    1    1    1   1    1   1      1    1   0    1  1
## 72    1   1   1    1    1    1   0    1   1      1    1   0    1  0
## 73    1   1   1    1    1    1   1    1   1      1    1   0    1  0
## 74    1   0   1    1    0    0   0    1   1      0    1   0    1  0
## 75    1   0   1    1    0    0   0    1   1      0    1   0    1  0
## 76    1   0   1    1    1    1   1    1   1      1    0   0    0  0
## 77    1   1   1    1    0    0   0    1   1      0    1   1    1  1
## 78    1   0   0    1    0    0   0    0   1      0    1   0    0  0
## 79    1   0   1    1    0    1   1    0   1      0    1   0    0  0
## 80    1   0   1    1    0    0   0    0   0      0    1   0    0  1
## 81    1   0   0    1    0    0   0    0   0      1    1   1    1  1
## 82    1   1   1    1    1    0   0    1   1      1    1   1    1  0
## 83    1   1   1    1    0    1   1    1   1      1    1   0    1  0
## 84    1   0   1    1    0    1   1    1   1      1    1   0    1  1
## 85    1   0   0    1    0    0   0    0   1      1    1   1    0  0
## 86    1   1   1    1    0    0   0    0   1      1    1   0    1  0
## 87    1   1   0    1    1    1   0    1   1      1    1   1    1  0
## 88    1   0   1    1    0    1   0    1   1      1    1   0    1  0
## 89    1   0   1    1    1    1   0    1   1      1    1   1    0  0
## 90    1   0   1    1    0    1   0    0   0      1    1   0    0  0
## 91    1   1   0    1    0    1   0    0   0      1    1   1    0  0
## 92    1   1   1    1    0    1   0    1   0      1    1   1    0  0
## 93    0   0   0    0    0    0   0    0   0      0    1   0    0  0
## 94    0   0   1    1    0    0   0    0   1      0    1   1    1  0
## 95    0   0   1    1    0    0   0    0   1      0    1   1    1  0
## 96    1   1   1    1    0    1   0    1   1      0    0   1    1  1
## 97    1   0   1    1    0    0   0    0   1      0    1   1    1  1
## 98    1   0   0    1    1    1   0    0   1      0    1   1    1  1
## 99    1   1   0    0    1    1   0    1   0      0    1   1    1  1
## 100   1   1   1    1    0    0   0    1   1      0    1   1    1  0
## 101   0   0   1    1    0    0   0    0   1      0    1   1    1  0
## 102   1   0   1    1    0    0   0    1   1      0    1   1    1  0
## 103   0   0   0    0    0    1   0    1   0      0    1   1    1  0
## 104   0   0   1    1    0    0   0    0   0      0    1   0    0  0
## 105   1   0   1    1    0    0   0    0   0      0    1   1    1  0
## 106   1   0   0    0    0    0   0    1   1      0    0   0    0  0
## 107   0   0   0    1    0    0   0    0   1      0    1   0    0  0
## 108   1   1   1    1    0    0   0    0   1      0    1   1    0  0
## 109   0   0   0    1    0    0   0    0   0      0    0   0    0  0
## 110   0   0   0    0    1    1   1    0   0      0    1   1    1  0
## 111   0   0   0    0    0    0   0    0   0      0    1   1    1  0
## 112   1   0   0    1    0    0   0    0   1      0    1   0    0  0
## 113   0   1   0    0    0    0   0    0   0      0    0   1    0  0
## 114   1   1   0    1    1    1   1    1   1      0    0   0    0  0
## 115   1   1   0    1    1    0   1    1   1      0    0   0    0  0
## 116   1   1   0    1    1    0   0    1   1      0    0   0    0  0
## 117   1   0   0    1    1    0   0    1   0      1    0   0    0  0
## 118   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 119   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 120   1   0   0    1    1    1   1    1   1      0    0   0    0  0
## 121   1   1   1    1    0    1   0    1   1      0    0   0    0  0
## 122   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 123   1   0   1    1    1    1   0    1   1      0    0   0    0  0
## 124   1   0   1    1    1    1   0    1   1      0    0   0    0  0
## 125   1   0   1    1    0    1   0    1   1      0    0   0    0  0
## 126   1   1   1    1    1    1   1    1   1      1    1   0    1  0
## 127   1   0   1    1    1    1   0    1   1      1    1   1    1  0
## 128   1   0   1    1    0    0   0    1   1      0    0   0    0  0
## 129   1   0   1    1    0    0   0    1   1      0    1   0    0  0
## 130   1   0   1    1    0    1   0    1   1      0    0   0    1  0
## 131   1   1   1    1    1    1   1    1   1      1    0   0    0  0
## 132   1   1   1    1    0    0   0    1   0      0    0   0    0  0
## 133   1   1   1    1    0    0   0    1   0      0    0   0    0  0
## 134   1   0   1    1    1    1   0    1   1      1    0   0    0  0
## 135   1   0   1    1    1    1   0    1   1      0    0   0    0  0
## 136   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 137   1   0   1    1    1    1   0    1   0      0    0   0    0  0
## 138   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 139   1   1   0    1    1    1   0    1   1      1    0   0    0  0
## 140   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 141   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 142   1   1   1    1    1    1   1    1   0      1    0   0    0  0
## 143   1   1   1    1    1    1   0    1   1      0    0   0    0  0
print(Fire_Dat)
##     Col Lus IOx Disc Crac Craz Exf Soot Adh FlScar Scar Rip Bulb PI
## 1     1   0   0    1    1    1   1    1   0      1    0   0    0  0
## 2     1   0   1    1    0    0   0    0   0      0    0   0    0  0
## 3     1   1   1    1    1    1   0    1   1      1    0   0    1  0
## 4     1   1   1    1    1    1   0    1   1      0    0   0    1  1
## 5     1   0   1    1    0    0   0    0   1      0    0   0    0  0
## 6     1   1   1    1    0    0   0    0   0      0    0   0    0  0
## 7     1   1   1    1    1    1   1    1   1      0    1   0    1  1
## 8     1   1   0    1    1    1   0    1   1      0    0   0    0  0
## 9     1   1   0    0    1    1   0    1   1      1    1   0    0  0
## 10    1   1   0    1    0    1   0    1   1      1    1   0    0  0
## 11    1   1   0    1    1    1   0    1   1      1    0   0    0  0
## 12    1   1   0    1    1    1   0    1   1      0    0   0    0  0
## 13    1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 14    1   1   0    1    1    1   0    1   1      0    0   0    0  0
## 15    1   1   0    1    1    1   1    1   1      0    0   0    0  0
## 16    0   0   1    1    0    0   0    1   1      0    0   0    0  0
## 17    1   0   0    1    1    1   0    1   0      1    0   0    0  0
## 18    1   0   0    1    0    0   0    0   0      0    1   0    1  0
## 19    1   0   0    1    0    0   0    0   0      0    1   0    0  0
## 20    1   0   0    1    0    0   0    0   0      0    1   0    0  0
## 21    1   0   0    1    0    0   0    0   0      0    1   0    0  0
## 22    1   1   1    1    1    1   0    1   1      1    0   0    0  0
## 23    1   0   0    1    0    0   0    1   1      0    0   0    0  0
## 24    1   1   1    1    1    0   0    1   1      0    0   0    0  0
## 25    1   1   0    1    1    1   0    1   1      1    1   0    0  0
## 26    1   1   0    1    0    0   0    1   0      0    0   0    0  0
## 27    1   0   0    1    0    1   0    1   1      0    0   0    0  0
## 28    1   0   0    1    0    0   0    1   1      0    0   0    0  0
## 29    1   0   1    1    1    1   0    1   1      0    0   0    0  0
## 30    1   0   1    1    1    1   1    1   1      1    0   0    0  0
## 31    1   0   1    1    0    1   0    1   1      0    0   0    0  0
## 32    1   0   1    1    1    1   1    1   1      0    0   0    0  0
## 33    1   0   0    1    0    1   0    1   1      0    0   0    0  0
## 34    1   0   1    1    0    1   1    1   1      0    0   0    0  0
## 35    1   0   1    1    0    1   1    1   1      0    0   0    0  0
## 36    1   0   1    1    1    1   0    1   1      0    0   0    0  0
## 37    1   0   1    1    1    1   1    1   1      1    0   0    0  0
## 38    1   0   1    1    1    1   0    1   1      1    1   0    0  0
## 39    1   0   0    1    0    0   0    0   1      1    1   0    0  0
## 40    1   0   1    0    0    0   0    0   0      0    1   0    0  0
## 41    1   0   0    1    0    1   0    0   1      0    1   0    1  0
## 42    1   0   0    0    0    0   0    1   0      0    1   0    1  0
## 43    1   0   0    1    0    0   0    0   0      0    1   0    0  0
## 44    0   0   0    0    0    0   0    0   0      0    1   0    0  0
## 45    1   0   0    1    0    0   0    1   1      0    0   0    0  0
## 46    1   0   0    1    0    0   0    0   1      0    0   0    0  0
## 47    0   0   0    0    0    0   0    1   0      0    0   0    0  0
## 48    1   0   1    1    0    1   1    1   1      1    0   0    0  0
## 49    1   0   1    1    0    1   0    1   1      0    1   0    0  0
## 50    1   0   0    1    0    0   0    0   1      0    1   0    0  0
## 51    1   0   0    0    0    0   0    1   0      0    0   0    0  0
## 52    1   0   1    1    1    1   0    1   1      1    1   0    0  1
## 53    1   0   1    1    1    1   0    1   1      0    1   0    1  0
## 54    1   1   1    1    0    0   0    1   1      0    1   0    0  1
## 55    1   0   0    1    0    0   0    1   1      0    1   0    0  0
## 56    1   1   1    1    0    0   0    1   1      0    1   0    0  0
## 57    1   1   1    1    0    0   0    1   1      0    1   0    0  0
## 58    1   1   1    1    0    0   0    1   1      0    1   0    1  0
## 59    1   1   1    1    0    1   0    1   1      1    1   0    1  0
## 60    1   1   1    1    0    1   0    1   1      0    1   1    1  1
## 61    1   1   1    1    1    1   1    1   1      1    1   0    1  1
## 62    1   1   1    1    1    1   1    1   1      1    1   0    1  1
## 63    1   1   0    0    0    0   0    1   0      0    1   1    0  0
## 64    1   1   0    0    0    0   0    1   0      0    1   0    0  0
## 65    1   1   0    0    0    0   0    1   0      1    1   1    1  1
## 66    1   1   1    1    0    0   0    0   1      0    1   0    1  0
## 67    1   1   0    1    0    0   0    0   0      0    1   1    1  1
## 68    1   0   1    1    1    1   1    1   1      1    0   0    0  0
## 69    1   0   1    1    0    0   0    0   1      0    1   1    1  1
## 70    1   1   1    1    0    0   0    1   1      0    1   0    1  1
## 71    1   1   1    1    1    1   1    1   1      1    1   0    1  1
## 72    1   1   1    1    1    1   0    1   1      1    1   0    1  0
## 73    1   1   1    1    1    1   1    1   1      1    1   0    1  0
## 74    1   0   1    1    0    0   0    1   1      0    1   0    1  0
## 75    1   0   1    1    0    0   0    1   1      0    1   0    1  0
## 76    1   0   1    1    1    1   1    1   1      1    0   0    0  0
## 77    1   1   1    1    0    0   0    1   1      0    1   1    1  1
## 78    1   0   0    1    0    0   0    0   1      0    1   0    0  0
## 79    1   0   1    1    0    1   1    0   1      0    1   0    0  0
## 80    1   0   1    1    0    0   0    0   0      0    1   0    0  1
## 81    1   0   0    1    0    0   0    0   0      1    1   1    1  1
## 82    1   1   1    1    1    0   0    1   1      1    1   1    1  0
## 83    1   1   1    1    0    1   1    1   1      1    1   0    1  0
## 84    1   0   1    1    0    1   1    1   1      1    1   0    1  1
## 85    1   0   0    1    0    0   0    0   1      1    1   1    0  0
## 86    1   1   1    1    0    0   0    0   1      1    1   0    1  0
## 87    1   1   0    1    1    1   0    1   1      1    1   1    1  0
## 88    1   0   1    1    0    1   0    1   1      1    1   0    1  0
## 89    1   0   1    1    1    1   0    1   1      1    1   1    0  0
## 90    1   0   1    1    0    1   0    0   0      1    1   0    0  0
## 91    1   1   0    1    0    1   0    0   0      1    1   1    0  0
## 92    1   1   1    1    0    1   0    1   0      1    1   1    0  0
## 93    0   0   0    0    0    0   0    0   0      0    1   0    0  0
## 94    0   0   1    1    0    0   0    0   1      0    1   1    1  0
## 95    0   0   1    1    0    0   0    0   1      0    1   1    1  0
## 96    1   1   1    1    0    1   0    1   1      0    0   1    1  1
## 97    1   0   1    1    0    0   0    0   1      0    1   1    1  1
## 98    1   0   0    1    1    1   0    0   1      0    1   1    1  1
## 99    1   1   0    0    1    1   0    1   0      0    1   1    1  1
## 100   1   1   1    1    0    0   0    1   1      0    1   1    1  0
## 101   0   0   1    1    0    0   0    0   1      0    1   1    1  0
## 102   1   0   1    1    0    0   0    1   1      0    1   1    1  0
## 103   0   0   0    0    0    1   0    1   0      0    1   1    1  0
## 104   0   0   1    1    0    0   0    0   0      0    1   0    0  0
## 105   1   0   1    1    0    0   0    0   0      0    1   1    1  0
## 106   1   0   0    0    0    0   0    1   1      0    0   0    0  0
## 107   0   0   0    1    0    0   0    0   1      0    1   0    0  0
## 108   1   1   1    1    0    0   0    0   1      0    1   1    0  0
## 109   0   0   0    1    0    0   0    0   0      0    0   0    0  0
## 110   0   0   0    0    1    1   1    0   0      0    1   1    1  0
## 111   0   0   0    0    0    0   0    0   0      0    1   1    1  0
## 112   1   0   0    1    0    0   0    0   1      0    1   0    0  0
## 113   0   1   0    0    0    0   0    0   0      0    0   1    0  0
## 114   1   1   0    1    1    1   1    1   1      0    0   0    0  0
## 115   1   1   0    1    1    0   1    1   1      0    0   0    0  0
## 116   1   1   0    1    1    0   0    1   1      0    0   0    0  0
## 117   1   0   0    1    1    0   0    1   0      1    0   0    0  0
## 118   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 119   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 120   1   0   0    1    1    1   1    1   1      0    0   0    0  0
## 121   1   1   1    1    0    1   0    1   1      0    0   0    0  0
## 122   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 123   1   0   1    1    1    1   0    1   1      0    0   0    0  0
## 124   1   0   1    1    1    1   0    1   1      0    0   0    0  0
## 125   1   0   1    1    0    1   0    1   1      0    0   0    0  0
## 126   1   1   1    1    1    1   1    1   1      1    1   0    1  0
## 127   1   0   1    1    1    1   0    1   1      1    1   1    1  0
## 128   1   0   1    1    0    0   0    1   1      0    0   0    0  0
## 129   1   0   1    1    0    0   0    1   1      0    1   0    0  0
## 130   1   0   1    1    0    1   0    1   1      0    0   0    1  0
## 131   1   1   1    1    1    1   1    1   1      1    0   0    0  0
## 132   1   1   1    1    0    0   0    1   0      0    0   0    0  0
## 133   1   1   1    1    0    0   0    1   0      0    0   0    0  0
## 134   1   0   1    1    1    1   0    1   1      1    0   0    0  0
## 135   1   0   1    1    1    1   0    1   1      0    0   0    0  0
## 136   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 137   1   0   1    1    1    1   0    1   0      0    0   0    0  0
## 138   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 139   1   1   0    1    1    1   0    1   1      1    0   0    0  0
## 140   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 141   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 142   1   1   1    1    1    1   1    1   0      1    0   0    0  0
## 143   1   1   1    1    1    1   0    1   1      0    0   0    0  0
print(Fire_Means)
##    Measure   Exp1   Exp2     Exp3
## 1        1 197.67 371.67 416.6667
## 2        2 286.00 643.33 770.6667
## 3        3 706.33 713.33 682.0000
## 4        4 562.33 643.33 670.6667
## 5        5 226.67 557.67 633.0000
## 6        6 336.67 534.33 625.3333
## 7        7 509.00 527.33 537.6667
## 8        8 553.00 485.67 424.6667
## 9        9 512.33 452.67 442.0000
## 10      10 393.33 436.00 353.0000
## 11      11 445.00 402.67 359.6667
## 12      12 489.67 456.33 302.0000
## 13      13 375.00 387.00 337.0000
## 14      14 445.00 404.00 311.3333
## 15      15 506.33 358.67 275.0000
## 16      16 385.67 379.67 271.6667
## 17      17 288.00 351.67 261.6667
## 18      18 301.67 336.33 299.6667
## 19      19 400.33 299.33 230.3333
## 20      20 329.00 300.33 230.6667
## 21      21 331.00 261.67 258.6667
## 22      22 304.33 236.33 260.0000
## 23      23 337.67 242.33 213.0000
## 24      24 284.33 239.67 223.3333
## 25      25 230.67 210.00 237.6667
## 26      26 226.67 227.67 227.0000
## 27      27 206.67 196.33 207.0000
## 28      28 211.00 176.67 227.3333
## 29      29 187.00 193.33 201.6667
## 30      30 208.67 193.00 218.6667
## 31      31 149.33 192.00 212.6667
## 32      32 180.67 201.67 175.6667
## 33      33 152.67 168.33 199.3333
## 34      34 161.33 184.33 196.3333
## 35      35 156.33 172.67 183.3333
## 36      36 157.33 154.00 182.6667
## 37      37 150.33 146.00 181.3333
## 38      38 138.00 152.67 155.0000
## 39      39  97.00 132.00 135.0000
## 40      40  54.33 117.33 143.0000
## 41      41  44.33 119.00 125.6667
print(RawTraits2)
##     Rock_Type Col Lus IOx Disc Crac Craz Exf Soot Adh FlScar Scar Rip Bulb PI
## 1          VA   1   0   0    1    1    1   1    1   0      1    0   0    0  0
## 2          VA   1   0   1    1    0    0   0    0   0      0    0   0    0  0
## 3          VA   1   1   1    1    1    1   0    1   1      1    0   0    1  0
## 4          VA   1   1   1    1    1    1   0    1   1      0    0   0    1  1
## 5          VA   1   0   1    1    0    0   0    0   1      0    0   0    0  0
## 6          VA   1   1   1    1    0    0   0    0   0      0    0   0    0  0
## 7          VA   1   1   1    1    1    1   1    1   1      0    1   0    1  1
## 8          VA   1   1   0    1    1    1   0    1   1      0    0   0    0  0
## 9          VA   1   1   0    0    1    1   0    1   1      1    1   0    0  0
## 10         VA   1   1   0    1    0    1   0    1   1      1    1   0    0  0
## 11         VA   1   1   0    1    1    1   0    1   1      1    0   0    0  0
## 12         VB   1   1   0    1    1    1   0    1   1      0    0   0    0  0
## 13         VA   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 14         VA   1   1   0    1    1    1   0    1   1      0    0   0    0  0
## 15         VB   1   1   0    1    1    1   1    1   1      0    0   0    0  0
## 16         VA   0   0   1    1    0    0   0    1   1      0    0   0    0  0
## 17         VB   1   0   0    1    1    1   0    1   0      1    0   0    0  0
## 18         VB   1   0   0    1    0    0   0    0   0      0    1   0    1  0
## 19         VB   1   0   0    1    0    0   0    0   0      0    1   0    0  0
## 20         VB   1   0   0    1    0    0   0    0   0      0    1   0    0  0
## 21         VB   1   0   0    1    0    0   0    0   0      0    1   0    0  0
## 22         VA   1   1   1    1    1    1   0    1   1      1    0   0    0  0
## 23         VA   1   0   0    1    0    0   0    1   1      0    0   0    0  0
## 24         VA   1   1   1    1    1    0   0    1   1      0    0   0    0  0
## 25         VB   1   1   0    1    1    1   0    1   1      1    1   0    0  0
## 26         VB   1   1   0    1    0    0   0    1   0      0    0   0    0  0
## 27         VB   1   0   0    1    0    1   0    1   1      0    0   0    0  0
## 28         VB   1   0   0    1    0    0   0    1   1      0    0   0    0  0
## 29         VB   1   0   1    1    1    1   0    1   1      0    0   0    0  0
## 30         VA   1   0   1    1    1    1   1    1   1      1    0   0    0  0
## 31         VB   1   0   1    1    0    1   0    1   1      0    0   0    0  0
## 32         VB   1   0   1    1    1    1   1    1   1      0    0   0    0  0
## 33         VA   1   0   0    1    0    1   0    1   1      0    0   0    0  0
## 34         VA   1   0   1    1    0    1   1    1   1      0    0   0    0  0
## 35         VA   1   0   1    1    0    1   1    1   1      0    0   0    0  0
## 36         VA   1   0   1    1    1    1   0    1   1      0    0   0    0  0
## 37         VA   1   0   1    1    1    1   1    1   1      1    0   0    0  0
## 38         VA   1   0   1    1    1    1   0    1   1      1    1   0    0  0
## 39         VA   1   0   0    1    0    0   0    0   1      1    1   0    0  0
## 40         VA   1   0   1    0    0    0   0    0   0      0    1   0    0  0
## 41         VA   1   0   0    1    0    1   0    0   1      0    1   0    1  0
## 42         VA   1   0   0    0    0    0   0    1   0      0    1   0    1  0
## 43         VA   1   0   0    1    0    0   0    0   0      0    1   0    0  0
## 44         VA   0   0   0    0    0    0   0    0   0      0    1   0    0  0
## 45         VA   1   0   0    1    0    0   0    1   1      0    0   0    0  0
## 46         VA   1   0   0    1    0    0   0    0   1      0    0   0    0  0
## 47         VA   0   0   0    0    0    0   0    1   0      0    0   0    0  0
## 48         VA   1   0   1    1    0    1   1    1   1      1    0   0    0  0
## 49         VA   1   0   1    1    0    1   0    1   1      0    1   0    0  0
## 50         VA   1   0   0    1    0    0   0    0   1      0    1   0    0  0
## 51         VA   1   0   0    0    0    0   0    1   0      0    0   0    0  0
## 52         VB   1   0   1    1    1    1   0    1   1      1    1   0    0  1
## 53         VB   1   0   1    1    1    1   0    1   1      0    1   0    1  0
## 54         VB   1   1   1    1    0    0   0    1   1      0    1   0    0  1
## 55         VB   1   0   0    1    0    0   0    1   1      0    1   0    0  0
## 56         VB   1   1   1    1    0    0   0    1   1      0    1   0    0  0
## 57         VB   1   1   1    1    0    0   0    1   1      0    1   0    0  0
## 58         VB   1   1   1    1    0    0   0    1   1      0    1   0    1  0
## 59         VB   1   1   1    1    0    1   0    1   1      1    1   0    1  0
## 60         VB   1   1   1    1    0    1   0    1   1      0    1   1    1  1
## 61         VB   1   1   1    1    1    1   1    1   1      1    1   0    1  1
## 62         VB   1   1   1    1    1    1   1    1   1      1    1   0    1  1
## 63         VB   1   1   0    0    0    0   0    1   0      0    1   1    0  0
## 64         VB   1   1   0    0    0    0   0    1   0      0    1   0    0  0
## 65         VB   1   1   0    0    0    0   0    1   0      1    1   1    1  1
## 66         VB   1   1   1    1    0    0   0    0   1      0    1   0    1  0
## 67         VB   1   1   0    1    0    0   0    0   0      0    1   1    1  1
## 68         VB   1   0   1    1    1    1   1    1   1      1    0   0    0  0
## 69         VB   1   0   1    1    0    0   0    0   1      0    1   1    1  1
## 70         VB   1   1   1    1    0    0   0    1   1      0    1   0    1  1
## 71         VB   1   1   1    1    1    1   1    1   1      1    1   0    1  1
## 72         VB   1   1   1    1    1    1   0    1   1      1    1   0    1  0
## 73         VB   1   1   1    1    1    1   1    1   1      1    1   0    1  0
## 74         VB   1   0   1    1    0    0   0    1   1      0    1   0    1  0
## 75         VB   1   0   1    1    0    0   0    1   1      0    1   0    1  0
## 76         VB   1   0   1    1    1    1   1    1   1      1    0   0    0  0
## 77         VB   1   1   1    1    0    0   0    1   1      0    1   1    1  1
## 78         VB   1   0   0    1    0    0   0    0   1      0    1   0    0  0
## 79         VB   1   0   1    1    0    1   1    0   1      0    1   0    0  0
## 80         VB   1   0   1    1    0    0   0    0   0      0    1   0    0  1
## 81         VB   1   0   0    1    0    0   0    0   0      1    1   1    1  1
## 82         VB   1   1   1    1    1    0   0    1   1      1    1   1    1  0
## 83         VB   1   1   1    1    0    1   1    1   1      1    1   0    1  0
## 84         VB   1   0   1    1    0    1   1    1   1      1    1   0    1  1
## 85         VB   1   0   0    1    0    0   0    0   1      1    1   1    0  0
## 86         VB   1   1   1    1    0    0   0    0   1      1    1   0    1  0
## 87         VB   1   1   0    1    1    1   0    1   1      1    1   1    1  0
## 88         VB   1   0   1    1    0    1   0    1   1      1    1   0    1  0
## 89         VB   1   0   1    1    1    1   0    1   1      1    1   1    0  0
## 90         VB   1   0   1    1    0    1   0    0   0      1    1   0    0  0
## 91         VB   1   1   0    1    0    1   0    0   0      1    1   1    0  0
## 92         VB   1   1   1    1    0    1   0    1   0      1    1   1    0  0
## 93         VB   0   0   0    0    0    0   0    0   0      0    1   0    0  0
## 94         VB   0   0   1    1    0    0   0    0   1      0    1   1    1  0
## 95         VB   0   0   1    1    0    0   0    0   1      0    1   1    1  0
## 96         VB   1   1   1    1    0    1   0    1   1      0    0   1    1  1
## 97         VB   1   0   1    1    0    0   0    0   1      0    1   1    1  1
## 98         VB   1   0   0    1    1    1   0    0   1      0    1   1    1  1
## 99         VB   1   1   0    0    1    1   0    1   0      0    1   1    1  1
## 100        VB   1   1   1    1    0    0   0    1   1      0    1   1    1  0
## 101        VB   0   0   1    1    0    0   0    0   1      0    1   1    1  0
## 102        VB   1   0   1    1    0    0   0    1   1      0    1   1    1  0
## 103        VB   0   0   0    0    0    1   0    1   0      0    1   1    1  0
## 104        VB   0   0   1    1    0    0   0    0   0      0    1   0    0  0
## 105        VB   1   0   1    1    0    0   0    0   0      0    1   1    1  0
## 106        VB   1   0   0    0    0    0   0    1   1      0    0   0    0  0
## 107        VB   0   0   0    1    0    0   0    0   1      0    1   0    0  0
## 108        VB   1   1   1    1    0    0   0    0   1      0    1   1    0  0
## 109        VB   0   0   0    1    0    0   0    0   0      0    0   0    0  0
## 110        VB   0   0   0    0    1    1   1    0   0      0    1   1    1  0
## 111        VB   0   0   0    0    0    0   0    0   0      0    1   1    1  0
## 112        VB   1   0   0    1    0    0   0    0   1      0    1   0    0  0
## 113        VB   0   1   0    0    0    0   0    0   0      0    0   1    0  0
## 114        VB   1   1   0    1    1    1   1    1   1      0    0   0    0  0
## 115        VB   1   1   0    1    1    0   1    1   1      0    0   0    0  0
## 116        VB   1   1   0    1    1    0   0    1   1      0    0   0    0  0
## 117        VB   1   0   0    1    1    0   0    1   0      1    0   0    0  0
## 118        VB   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 119        VB   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 120        VB   1   0   0    1    1    1   1    1   1      0    0   0    0  0
## 121        VB   1   1   1    1    0    1   0    1   1      0    0   0    0  0
## 122        VB   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 123        VB   1   0   1    1    1    1   0    1   1      0    0   0    0  0
## 124        VB   1   0   1    1    1    1   0    1   1      0    0   0    0  0
## 125        VB   1   0   1    1    0    1   0    1   1      0    0   0    0  0
## 126        VA   1   1   1    1    1    1   1    1   1      1    1   0    1  0
## 127        VA   1   0   1    1    1    1   0    1   1      1    1   1    1  0
## 128        VA   1   0   1    1    0    0   0    1   1      0    0   0    0  0
## 129        VA   1   0   1    1    0    0   0    1   1      0    1   0    0  0
## 130        VA   1   0   1    1    0    1   0    1   1      0    0   0    1  0
## 131        VA   1   1   1    1    1    1   1    1   1      1    0   0    0  0
## 132        VA   1   1   1    1    0    0   0    1   0      0    0   0    0  0
## 133        VA   1   1   1    1    0    0   0    1   0      0    0   0    0  0
## 134        VB   1   0   1    1    1    1   0    1   1      1    0   0    0  0
## 135        VB   1   0   1    1    1    1   0    1   1      0    0   0    0  0
## 136        VA   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 137        VA   1   0   1    1    1    1   0    1   0      0    0   0    0  0
## 138        VB   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 139        VB   1   1   0    1    1    1   0    1   1      1    0   0    0  0
## 140        VA   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 141        VA   1   1   1    1    1    1   0    1   1      0    0   0    0  0
## 142        VB   1   1   1    1    1    1   1    1   0      1    0   0    0  0
## 143        VB   1   1   1    1    1    1   0    1   1      0    0   0    0  0
print(Frag_Vol)
##     Volume Frag
## 1  128.772    0
## 2  326.536    0
## 3  262.080    0
## 4  260.442    0
## 5   35.280    0
## 6  179.400    0
## 7  290.360    2
## 8  230.050    0
## 9  390.720    0
## 10 241.020    2
## 11 455.328    0
## 12 611.010    0
## 13 247.104    0
## 14 217.620    5
## 15 297.369    6
## 16 290.880    0
## 17 357.840    4
## 18 136.500    0
## 19 170.100    3
## 20 278.850    0
## 21 214.500    0
## 22 572.355    0
## 23 284.130    0
## 24 115.200    3
## 25 215.730    0
## 26 241.056    0
## 27 154.734    3
## 28 598.575    0
## 29 161.280    0
## 30 319.200    2
## 31 127.280    0
## 32  71.680   10
## 33 113.220    0
## 34 205.200    2
## 35  73.749    0
## 36 180.000    0
## 37 336.600    0
## 38  60.320    0
## 39 180.320    5
## 40 404.712    0
## 41 402.215    0
## 42 226.352    0
## 43 394.630    0
## 44 591.075    0
## 45 163.530    2
## 46 136.000    0
## 47  97.539    0
## 48 183.150   31
## 49 304.803    0
## 50 132.000    0
## 51 232.400    0
## 52  58.996    0
## 53 430.100    0
## 54 128.928    0
## 55 328.860    5
## 56 143.820    0
## 57 145.728    2
## 58  26.609    6
## 59 270.300    0
## 60 469.000    0
#Analysis of experimental data. Fire variation
FireLong<- melt(Fire_Means, ##reshape to extended format
                variable.name = "Exp", 
                value.name = "Temp", 
                measure.var = c("Exp1", "Exp2", "Exp3"), 
                na.rm = TRUE)

colnames(FireLong)[colnames(FireLong) == "value"] <- "Temp"

colnames(FireLong)[colnames(FireLong) == "variable"] <- "Exp"

##Mean of all firings
Global_Mean <- aggregate(Temp ~ Measure, data = FireLong, mean)##mean of all
#experiments



##Descriptive statistics of the mean temperature of the three experiments
print(summary(Global_Mean$Temp))
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   96.33  186.00  283.78  307.12  394.11  700.55
##Plot##
ggplot(FireLong, aes(x = Measure, y = Temp, group = Exp)) +
  geom_line(aes(color = Exp)) +  
  geom_point(aes(color = Exp)) +  
  geom_smooth(data = Global_Mean , aes(x = Measure, y = Temp), 
              method = "loess", se = FALSE, color = "black", group = 1)+
  theme_classic()
## `geom_smooth()` using formula = 'y ~ x'

###comparison between average mean of each experiment 
Temp_Test <- kruskal.test(Temp ~ Exp, data =FireLong)

print(Temp_Test)
## 
##  Kruskal-Wallis rank sum test
## 
## data:  Temp by Exp
## Kruskal-Wallis chi-squared = 0.11682, df = 2, p-value = 0.9433

Experimental setting

cpTemp =cpt.mean(Global_Mean$Temp)

# Results
print(cpTemp)
## Class 'cpt' : Changepoint Object
##        ~~   : S4 class containing 12 slots with names
##               cpttype date version data.set method test.stat pen.type pen.value minseglen cpts ncpts.max param.est 
## 
## Created on  : Mon Nov 25 09:42:11 2024 
## 
## summary(.)  :
## ----------
## Created Using changepoint version 2.3 
## Changepoint type      : Change in mean 
## Method of analysis    : PELT 
## Test Statistic  : Normal 
## Type of penalty       : MBIC with value, 11.14072 
## Minimum Segment Length : 1 
## Maximum no. of cpts   : Inf 
## Number of changepoints: 34
plot(cpTemp)

# Mean before change point
mean_before=mean(Global_Mean$Temp[1:16])
print(mean_before)
## [1] 460.3334
#Mean after change point
mean_after= mean(Global_Mean$Temp[16:length(Global_Mean$Temp)])
print(mean_after)
## [1] 214.3204
# Effect sife of KW test
Fire_EfSize=kruskal_effsize(FireLong,Temp ~ Exp,
  ci = TRUE, conf.level = 0.95, ci.type = "perc",nboot = 1000)

print(Fire_EfSize)
## # A tibble: 1 × 7
##   .y.       n effsize conf.low conf.high method  magnitude
## * <chr> <int>   <dbl>    <dbl>     <dbl> <chr>   <ord>    
## 1 Temp    123 -0.0157    -0.02      0.05 eta2[H] small
##Chi2 test with Fragmented vs Entire acid and basic vulcanites
dat = data.frame(
  Rock = c("VA", "VB"),
  Entire = c(16, 23),
  Fragmented = c(25, 61)
)

table_Frag = as.matrix(dat[, -1])

row.names(table_Frag) = dat$Rock


print(table_Frag)
##    Entire Fragmented
## VA     16         25
## VB     23         61
##proportions by row
print(prop.table(table_Frag,1))
##       Entire Fragmented
## VA 0.3902439  0.6097561
## VB 0.2738095  0.7261905
# Chi2 test
Chisq_Frag=chisq.test(table_Frag)

print(Chisq_Frag)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  table_Frag
## X-squared = 1.2399, df = 1, p-value = 0.2655
##Effect size (Square root of the chi-square value divided by the number of degrees of freedom)

EffectFrag=sqrt(Chisq_Frag$statistic /sum(table_Frag))

EffectFrag
##  X-squared 
## 0.09959684
##Chi2 test of fragmentation by shape of the nodules

dat2 = data.frame(
  Shape = c("Tabular", "Elliptic"),
  Entire = c(9, 34),
  Fragmented = c(13, 80)
)


table_frag_shape = as.matrix(dat2[, -1])


row.names(table_frag_shape) = dat2$Shape


print(table_frag_shape)
##          Entire Fragmented
## Tabular       9         13
## Elliptic     34         80
##proporion of fragmentation by shape
print(prop.table(table_frag_shape,1))
##             Entire Fragmented
## Tabular  0.4090909  0.5909091
## Elliptic 0.2982456  0.7017544
# Chi2 test
chisq_Shape=chisq.test(table_frag_shape)

print(chisq_Shape)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  table_frag_shape
## X-squared = 0.598, df = 1, p-value = 0.4393
##Effect size (Square root of the chi-square value divided by the number of degrees of freedom)
EffectShape=sqrt(chisq_Shape$statistic /sum(table_frag_shape))

print(EffectShape)
##  X-squared 
## 0.06631012
traits_by_rocktype <- aggregate(. ~ Rock_Type, data = RawTraits2, sum)
print(traits_by_rocktype) 
##   Rock_Type Col Lus IOx Disc Crac Craz Exf Soot Adh FlScar Scar Rip Bulb PI
## 1        VA  46  19  31   43   22   29   9   39  37     14   15   1    8  2
## 2        VB  83  44  56   84   37   48  16   64  68     28   61  28   38 18
tab<- as.table(as.matrix(traits_by_rocktype[, -1])) 
rownames(tab) <- c("VA", "VB")

##proportion of each alteration by rock type
print(prop.table(tab,1))
##            Col         Lus         IOx        Disc        Crac        Craz
## VA 0.146031746 0.060317460 0.098412698 0.136507937 0.069841270 0.092063492
## VB 0.123328380 0.065378900 0.083209510 0.124814264 0.054977712 0.071322437
##            Exf        Soot         Adh      FlScar        Scar         Rip
## VA 0.028571429 0.123809524 0.117460317 0.044444444 0.047619048 0.003174603
## VB 0.023774146 0.095096582 0.101040119 0.041604755 0.090638930 0.041604755
##           Bulb          PI
## VA 0.025396825 0.006349206
## VB 0.056463596 0.026745914
##Chi2 test by rocktype
Xtest_by_rocktype<- chisq.test(tab)

print(Xtest_by_rocktype)
## 
##  Pearson's Chi-squared test
## 
## data:  tab
## X-squared = 30.996, df = 13, p-value = 0.003376
#plot
assoc(tab, shade=T)

# Exttact residuals
norm_res <- Xtest_by_rocktype$res

# Show normalized residuals
print(norm_res)
##           Col        Lus        IOx       Disc       Crac       Craz        Exf
## VA  0.7596040 -0.2423236  0.6193939  0.3943128  0.7353408  0.8982089  0.3646004
## VB -0.5196788  0.1657843 -0.4237548 -0.2697669 -0.5030792 -0.6145045 -0.2494393
##          Soot        Adh     FlScar       Scar        Rip       Bulb         PI
## VA  1.0751051  0.6089416  0.1665091 -1.8752289 -2.7118457 -1.7406404 -1.7331531
## VB -0.7355271 -0.4166039 -0.1139163  1.2829273  1.8552939  1.1908493  1.1857269
##Effect size (Square root of the chi-square value divided by the number of degrees of freedom)

EffectType=sqrt(Xtest_by_rocktype$statistic /sum(tab))
print(EffectType)
## X-squared 
## 0.1771238
Frag_Vol$Frag=as.numeric(Frag_Vol$Frag)
cor_Vol_Frag=cor.test(Frag_Vol$Volume, Frag_Vol$Frag, method="spearman")
## Warning in cor.test.default(Frag_Vol$Volume, Frag_Vol$Frag, method =
## "spearman"): Cannot compute exact p-value with ties
print(cor_Vol_Frag)
## 
##  Spearman's rank correlation rho
## 
## data:  Frag_Vol$Volume and Frag_Vol$Frag
## S = 41500, p-value = 0.2429
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
##        rho 
## -0.1530926
#Network analysis between fire related binary variables
Net_Fire <- estimateNetwork(Fire_Dat, default = "IsingFit")
## Estimating Network. Using package::function:
##   - IsingFit::IsingFit for network computation
##     - Using glmnet::glmnet
##   |                                                                              |                                                                      |   0%  |                                                                              |=====                                                                 |   7%  |                                                                              |==========                                                            |  14%  |                                                                              |===============                                                       |  21%  |                                                                              |====================                                                  |  29%  |                                                                              |=========================                                             |  36%  |                                                                              |==============================                                        |  43%  |                                                                              |===================================                                   |  50%  |                                                                              |========================================                              |  57%  |                                                                              |=============================================                         |  64%  |                                                                              |==================================================                    |  71%  |                                                                              |=======================================================               |  79%  |                                                                              |============================================================          |  86%  |                                                                              |=================================================================     |  93%  |                                                                              |======================================================================| 100%
#plot
Net_Graph=plot(Net_Fire)##network grafo

##Using igraph package to estimate clusters of variables
##transform to igraph object
Net_Fire_Ig= as.igraph(Net_Graph, attributes=TRUE)
##estimate communalities
Net_Clust<- cluster_spinglass(Net_Fire_Ig, implementation = c("neg"))

Net_Clust
## IGRAPH clustering spinglass, groups: 3, mod: 0.48
## + groups:
##   $`1`
##   [1] 1 2 3 4 8 9
##   
##   $`2`
##   [1]  5  6  7 10
##   
##   $`3`
##   [1] 11 12 13 14
## 
##Create a dataframe with clustermembership
Comm_Data=data.frame(Net_Clust$membership)

##transform numeric membership into factor
Comm_Data$Net_Clust.membership=as.factor(Comm_Data$Net_Clust.membership)
###Network plot with group membership estimated by igrapgh
items=c("Color alteration.",
        "Luster.",
        "Iron Oxidation.",
        "Discoloration.",
        "Cracking.",
        "Crazing.",
        "Exfoliation.",
        "Sooting.",
        "Adherences.",
        "Flake scars.",
        "Scars.",
        "Ripples.",
        "Bulb.",
        "Point of impact.")

plot(Net_Fire, 
     layout = "spring",
     groups =Comm_Data$Net_Clust.membership, 
     label.cex = 0.7, # scalar on label size
     label.color = 'black', # string on label colors
     label.prop = 0.9, # proportion of the width of the node
     # that the label scales
     legend.cex = 0.4, # scalar of the legend
     legend.mode = 'style2', 
     nodeNames = items, 
     font = 2)

### plot centrality coefficients to explore node attributes
centralityPlot(Net_Fire, include = c("Strength", "Betweenness","ExpectedInfluence") , scale="z-scores")
## Note: z-scores are shown on x-axis rather than raw centrality indices.

  1. Strength
    • Soot: Highest strength, indicating strong connections with other nodes.
    • Adh: Lowest strength, indicating fewer or weaker connections.
  2. Betweenness
    • Soot: Highest betweenness, indicating it often lies on the shortest paths between other nodes.
    • Col, Bulb, Adh: Lowest betweenness, indicating they rarely lie on shortest paths.
  3. Expected Influence
    • Craz: Highest expected influence, suggesting it has a strong overall impact on the network, followed by Soot.
    • Col, Bulb, Adh: Lowest expected influence, indicating minimal overall impact.