STATISTICAL ANALYSIS OF CPTu
IN R STUDIO
Example guide with sample dataset,
R code, and basic plots
Generated by ChatGPT
1. INTRODUCTION & DATA STRUCTURE
This report presents an example workflow for statistical analysis of CPTu data using R Studio.
Sample dataset structure:
- Depth_m : depth in meters
- qc_MPa : cone tip resistance in MPa
- fs_kPa : sleeve friction in kPa
- u2_kPa : pore pressure u2 in kPa
From these measurements, normalized CPT parameters Qt, Fr, and Bq are computed with typical
assumptions for total and effective overburden stresses. The same workflow can be applied to
your real project data by replacing the sample CSV file with your own CPTu file.
2. DESCRIPTIVE STATISTICS
Descriptive statistics for the sample CPTu dataset (computed in Python here, but the
same results can be obtained in R using summary() or dplyr::summarise()):
qc_MPa fs_kPa u2_kPa Qt Fr Bq
count 40.000000 40.000000 40.000000 40.000000 40.000000 40.000000
mean 9.350034 97.263730 84.421358 194.484517 1.059523 -0.000861
std 2.263404 25.788412 20.374156 264.982642 0.140174 0.004385
min 5.418178 48.937298 42.178801 71.172612 0.769940 -0.006538
25% 7.452654 80.137111 71.954996 86.788945 0.968944 -0.004461
50% 9.043481 96.327954 79.583941 110.097718 1.035826 -0.001685
75% 11.418601 120.546546 104.723816 173.241916 1.167969 0.001779
max 13.561904 140.561653 117.377653 1612.269079 1.367208 0.008838
These statistics give an overview of the central tendency and dispersion of each variable.
Cone Tip Resistance qc vs Depth
0.0
2.5
5.0
7.5
Depth (m)
10.0
12.5
15.0
17.5
20.0
6 7 8 9 10 11 12 13
qc (MPa)
Pore Pressure u2 vs Depth
0.0
2.5
5.0
7.5
Depth (m)
10.0
12.5
15.0
17.5
20.0
40 50 60 70 80 90 100 110 120
u2 (kPa)
Qt Fr Scatter Plot (Robertson-type space, simplified)
Fr (%)
100
9 × 10 1
8 × 10 1
102 103
Qt
APPENDIX A R CODE EXAMPLE
# ==== 1. Load packages ====
library(readr)
library(dplyr)
library(ggplot2)
# ==== 2. Read data ====
cpt <- read_csv("cptu_data.csv")
# ==== 3. Compute stresses & normalized parameters ====
gamma <- 18 # kN/m3
gamma_w <- 9.81 # kN/m3
cpt <- cpt %>%
mutate(
sigma_v0 = Depth_m * gamma,
u0 = Depth_m * gamma_w,
sigma_v0_eff = sigma_v0 - u0,
Qt = (qc_MPa*1000 - sigma_v0) / sigma_v0_eff,
Fr = (fs_kPa / (qc_MPa*1000 - sigma_v0)) * 100,
Bq = (u2_kPa - u0) / (qc_MPa*1000 - sigma_v0)
)
# ==== 4. Descriptive statistics ====
summary(select(cpt, qc_MPa, fs_kPa, u2_kPa, Qt, Fr, Bq))
# ==== 5. Depth profiles ====
ggplot(cpt, aes(qc_MPa, Depth_m)) +
geom_path() +
scale_y_reverse() +
labs(x = "qc (MPa)", y = "Depth (m)") +
theme_minimal()
ggplot(cpt, aes(u2_kPa, Depth_m)) +
geom_path() +
scale_y_reverse() +
labs(x = "u2 (kPa)", y = "Depth (m)") +
theme_minimal()
# ==== 6. Robertson Qt Fr chart (simplified scatter) ====
ggplot(cpt, aes(Qt, Fr)) +
geom_point(alpha = 0.7) +
scale_x_log10() +
scale_y_log10() +
labs(x = "Qt", y = "Fr (%)") +
theme_minimal()