Concrete is a highly complex material. The slump, flow and compressive strength of concrete is not only determined by the water content, but that is also influenced by other concrete ingredients.
This article aims to draw the traits on relationship of: Slump, Flow and Compressive Strength of concrete regarding its ingredients.
The dataset can be looked at clicking on this link.
First, setting not to show messages or warnings:
knitr::opts_chunk$set(message= FALSE)
knitr::opts_chunk$set(warning= FALSE)
setwd("~/Analisis de Datos/Practicas en R/Estudio del concreto")
datos <- read.csv("slump_test.txt",header= TRUE, sep=",",stringsAsFactors= FALSE, dec=".")
#The first column (N?) is not related to the analysis
datos <- datos[,-1]
#For practical purposes, let's change the output Data Set attribute names to capitalcase
colnames(datos)[8:10] <- c( "SLUMP","FLOW","FC")
#Making the convertion of Compressive Strength's units from MPa to kgf/cm?
datos$FC <- round(datos$FC*10.197,0)
Remember: \(1MPa=10.197kgf/cm?\)
library(psych)
library(party)
library(DT)
datatable(datos, class= "cell-border stripe")
| Values: | Unit: |
|---|---|
| Imput values (the first 7 columns) | kg/m? |
| SLUMP | cm |
| FLOW | cm |
| FC | 28-day Compressive Strength in kg/cm? |
pairs.panels(datos, pch=21,main="Matrix of Dispersion, Histogram and Correlation")
Using the package party and with a simple programming, you can appreciate the trees on an easy way.
#Excluding FLOW and FC
DSLUMP <- datos[,-(9:10)]
MSLUMP <- ctree(SLUMP ~.,data= DSLUMP)
plot(MSLUMP, main= "Slump Decision Tree")
#Excluding SLUMP and FC
DFLOW <- datos[,-8]
DFLOW <- DFLOW[,-9]
MFLOW <- ctree(FLOW ~.,data=DFLOW)
plot(MFLOW, main= "Flow Decision Tree")
#In the same way, excluding SLUMP and FLOW
DCS <- datos[,-c(8,9)]
MCS <- ctree(FC ~.,data=DCS)
plot(MCS, main= "Compressive Strength Decision Tree")