ggflowcurve: Plot the flow curve from one or more liquid limit tests

View source: R/ggflowcurve.R

ggflowcurveR Documentation

Plot the flow curve from one or more liquid limit tests

Description

The water content is plotted on the y-axis with a linear scale while the blow count is plotted on the x-axis with a natural log scale. The liquid limit is computed as the water content at which a groove cut through the soil specimen closes over a width of 12.5 mm after 25 blows. The liquid can be computed with compute_LL().

Usage

ggflowcurve(df, ...)

Arguments

df

a data frame containing named columns water_content() and blow_count()

...

additional aesthetic mappings passed onto geom_point() and geom_smooth().

Details

\lifecycle

experimental

Value

a 'gg' plot object

See Also

add_w(), compute_LL()

Examples

# These operations work best with the pipe and other tidyverse conventions
library(dplyr)
library(magrittr)
library(purrr)
library(tidyr)
library(ggplot2)

# one sample
sample_3 <- example_LL_data[9:12, ] %>%
  left_join(example_tin_tares$`2020-05-24`) %>%
  add_w()
ggflowcurve(sample_3)

# three samples, faceted

example_LL_data %>%
  left_join(example_tin_tares$`2020-05-24`) %>%
  add_w() %>%
  ggflowcurve()+
  facet_wrap(~expt_mix_num)

# add colors and vertical arrows mapped to the LL in order to highlight the blow count of
# 25

lines_data <- example_LL_data %>%
  left_join(example_tin_tares$`2020-05-24`) %>%
  add_w() %>%
  group_by(expt_mix_num) %>%
  nest() %>%
  mutate(LL = map_dbl(data, compute_LL),
         blow_count = 25) %>%
  ungroup()

fulldata <- example_LL_data %>%
  left_join(example_tin_tares$`2020-05-24`) %>%
  add_w()

ggflowcurve(fulldata, color = factor(expt_mix_num))+
  geom_segment(data= lines_data,
               aes(x= blow_count, xend= blow_count, y= -Inf, yend = LL*0.99),
               arrow = arrow(length = unit(0.1, "in"))) +
  labs(color= "Mix number")+
  facet_wrap(~expt_mix_num)


evanmascitti/soiltestr documentation built on Oct. 6, 2022, 5:32 p.m.