printer_data <- read.csv("C:/Users/Huy Hoang/Downloads/data.csv")
head(printer_data,3)
##   layer_height wall_thickness infill_density infill_pattern nozzle_temperature
## 1         0.02              8             90           grid                220
## 2         0.02              7             90      honeycomb                225
## 3         0.02              1             80           grid                230
##   bed_temperature print_speed material fan_speed roughness tension_strenght
## 1              60          40      abs         0        25               18
## 2              65          40      abs        25        32               16
## 3              70          40      abs        50        40                8
##   elongation
## 1        1.2
## 2        1.4
## 3        0.8
new_DF <-printer_data[,c("layer_height","wall_thickness","infill_density",
"infill_pattern","nozzle_temperature","bed_temperature","print_speed",
"material","fan_speed","tension_strenght","elongation")]
head(new_DF,3)
##   layer_height wall_thickness infill_density infill_pattern nozzle_temperature
## 1         0.02              8             90           grid                220
## 2         0.02              7             90      honeycomb                225
## 3         0.02              1             80           grid                230
##   bed_temperature print_speed material fan_speed tension_strenght elongation
## 1              60          40      abs         0               18        1.2
## 2              65          40      abs        25               16        1.4
## 3              70          40      abs        50                8        0.8
library(questionr)
freq.na(new_DF)
##                    missing %
## layer_height             0 0
## wall_thickness           0 0
## infill_density           0 0
## infill_pattern           0 0
## nozzle_temperature       0 0
## bed_temperature          0 0
## print_speed              0 0
## material                 0 0
## fan_speed                0 0
## tension_strenght         0 0
## elongation               0 0
new_function <- function(x){c(n=length(x),xtb=mean(x),sd=sd(x),Q1=quantile(x,probs=0.25),
  Q2=median(x),Q3=quantile(x,probs=0.75),min=min(x),max=max(x))}

continous_data <- new_DF[,c("layer_height","wall_thickness","infill_density",
"nozzle_temperature","bed_temperature","print_speed","fan_speed","tension_strenght","elongation")]

apply(continous_data,2,new_function)
##        layer_height wall_thickness infill_density nozzle_temperature
## n       50.00000000      50.000000       50.00000           50.00000
## xtb      0.10600000       5.220000       53.40000          221.50000
## sd       0.06439673       2.922747       25.36348           14.82035
## Q1.25%   0.06000000       3.000000       40.00000          210.00000
## Q2       0.10000000       5.000000       50.00000          220.00000
## Q3.75%   0.15000000       7.000000       80.00000          230.00000
## min      0.02000000       1.000000       10.00000          200.00000
## max      0.20000000      10.000000       90.00000          250.00000
##        bed_temperature print_speed fan_speed tension_strenght elongation
## n            50.000000     50.0000  50.00000        50.000000 50.0000000
## xtb          70.000000     64.0000  50.00000        20.080000  1.6720000
## sd            7.142857     29.6923  35.71429         8.925634  0.7881883
## Q1.25%       65.000000     40.0000  25.00000        12.000000  1.1000000
## Q2           70.000000     60.0000  50.00000        19.000000  1.5500000
## Q3.75%       75.000000     60.0000  75.00000        27.000000  2.1750000
## min          60.000000     40.0000   0.00000         4.000000  0.4000000
## max          80.000000    120.0000 100.00000        37.000000  3.3000000
hist(new_DF$tension_strenght,
     xlab = "tension_strenght",
     main = "Histogram of tension_strenght",
     col = "pink",
     labels = T,
     ylim = c(0,15))