| Title: | Cluster and Plot Soil, Sediment, and Paleoenvironmental Data |
|---|---|
| Description: | Functions to help geoarchaeologists, paleoenvironmental scientists, and geoscientists create clear, publication-ready figures of soil data without the need for additional licensed software. Functions allow users to cluster and visualize across multiple soil profiles, allowing geoarchaeologists to recognize and compare geomorphological and paleoenvironmental trends across entire landscapes. |
| Authors: | Gwen Olivier [aut, cre] (ORCID: <https://orcid.org/0009-0009-1960-2152>), Samuel R. Borstein [aut] (ORCID: <https://orcid.org/0000-0002-7258-141X>) |
| Maintainer: | Gwen Olivier <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 0.1.0 |
| Built: | 2026-11-08 20:50:23 UTC |
| Source: | https://github.com/cran/tRowel |
Plots proxies with a bar plot
buriedBar( pollendata, proxies, depth, title = NULL, barcolors = NA, legendtitle = NULL, value_pos = TRUE, legend_pos = TRUE, measurement_lab, depth_lab = NA, depth_axis = TRUE, top_is_zero = TRUE, depth_intervals = 10, min_depth = 0, max_depth, min_measure = NA, max_measure = NA, measure_intervals = NA, panel_format = "single" )buriedBar( pollendata, proxies, depth, title = NULL, barcolors = NA, legendtitle = NULL, value_pos = TRUE, legend_pos = TRUE, measurement_lab, depth_lab = NA, depth_axis = TRUE, top_is_zero = TRUE, depth_intervals = 10, min_depth = 0, max_depth, min_measure = NA, max_measure = NA, measure_intervals = NA, panel_format = "single" )
pollendata |
Dataframe of paleoenvironmental data. |
proxies |
Columns to be plotted. |
depth |
Character. Name of column containing starting depth data. |
title |
Character. Name of plot. |
barcolors |
Character Vector. Assigned colors for bar plot. |
legendtitle |
Character. Title of legend in plot. |
value_pos |
Boolean. TRUE places X-axis labels at the bottom of the plot |
legend_pos |
Boolean. TRUE places the legend at the top of plot |
measurement_lab |
Character. Label for the X-axis |
depth_lab |
Character. Label for the Y-axis. Default is the name of the depth column. |
depth_axis |
Should the depth axis be plotted. Default is TRUE. |
top_is_zero |
Boolean. If TRUE, the top of the plot will have a depth of 0. If FALSE, the top of plot will be max depth. |
depth_intervals |
Numeric. Sets the intervals for the Y-axis. Default is 10. |
min_depth |
Numeric. Minimum depth of the dataset. Default is 0. |
max_depth |
Numeric. Required maximum depth for the Y-axis. Allows the user to extend the graph to match other depths in paleoPanel(). For a shorter graph, the user must filter the data. |
min_measure |
Numeric. Adjusts X-axis min number. |
max_measure |
Numeric. Adjusts X-axis max number. |
measure_intervals |
Numeric. Adjusts X-axis intervals. |
panel_format |
Format for plotting. Can be either panel or single. If single, elements are all plotted on the same plot. If panel, the plot will be constructed as a facet plot. Default is single. |
This function plots a side-by-side bar graph to analyze and compare the quantity of pollen (or other proxy) by depth.
A bar plot of pollen amounts.
Gwen Olivier
# example code data("testPit") #filter for one profile, in this case profile 5 testPitP5 <- dplyr::filter(testPit, ProfileID == "Profile_5") buriedBar(testPitP5, proxies = c("Ca","Mg"),depth = "Depth_cm_Start", measurement_lab = "PPM", max_depth = 140, top_is_zero = TRUE, barcolors = c("blue","green")) #plot each element in its own panel buriedBar(testPitP5, proxies = c("Ca","Mg"),depth = "Depth_cm_Start", measurement_lab = "PPM", max_depth = 140, top_is_zero = TRUE, barcolors = c("blue","green"), panel_format = "panel", title = "Panel Plot")# example code data("testPit") #filter for one profile, in this case profile 5 testPitP5 <- dplyr::filter(testPit, ProfileID == "Profile_5") buriedBar(testPitP5, proxies = c("Ca","Mg"),depth = "Depth_cm_Start", measurement_lab = "PPM", max_depth = 140, top_is_zero = TRUE, barcolors = c("blue","green")) #plot each element in its own panel buriedBar(testPitP5, proxies = c("Ca","Mg"),depth = "Depth_cm_Start", measurement_lab = "PPM", max_depth = 140, top_is_zero = TRUE, barcolors = c("blue","green"), panel_format = "panel", title = "Panel Plot")
Statistically cluster (Gower's or Euclidean) and graphically display soil/sediment data as a profile
clastCluster( dirtdata, distance, depthStart, depthEnd, profile = NULL, ordination = FALSE, minK = 2, maxK = 10, nstart = 50, plot = TRUE, depthticks = 10, minDepth = 0, maxDepth = NULL, clusterColors = c("#DCC7AA", "#A68A6D", "#6E5A48", "#D29F6C", "#E8D3A1", "#4F4336", "#AAB8B4", "#4A615D", "#B3A79E", "#8B3A1C", "#C15629"), profileOrder = NULL, profileName = NULL, plotTitle = NULL, labelOrientation = 45, scaleData = TRUE, weight = "equal", groups = NULL )clastCluster( dirtdata, distance, depthStart, depthEnd, profile = NULL, ordination = FALSE, minK = 2, maxK = 10, nstart = 50, plot = TRUE, depthticks = 10, minDepth = 0, maxDepth = NULL, clusterColors = c("#DCC7AA", "#A68A6D", "#6E5A48", "#D29F6C", "#E8D3A1", "#4F4336", "#AAB8B4", "#4A615D", "#B3A79E", "#8B3A1C", "#C15629"), profileOrder = NULL, profileName = NULL, plotTitle = NULL, labelOrientation = 45, scaleData = TRUE, weight = "equal", groups = NULL )
dirtdata |
Data frame containing soil characteristic data for clustering.Should have unique rownames. |
distance |
Character. Either Euclidean or Gower. If you have only numeric data, use Euclidean. If your data contains a mix of data types, use Gower. |
depthStart |
Character. Name of the column in dirtdata containing information on the starting depth of sample. |
depthEnd |
Character. Name of the column in dirtdata containing information on the ending depth of sample. |
profile |
Character. Name of column containing profile IDs if multiple soil profiles exist in dirtdata. If a single profile, set to Null. Default is NULL (i.e. a single profile). |
ordination |
Logical. Should an ordination of the data be performed and plotted. Default is FALSE. If distance = Euclidean, Principle Component Analysis (PCA) is performed. If distance = Gower, a Principle Co-ordinate Analysis (PCoA) is performed. |
minK |
Numeric. Minimum number of clusters to try. Default is 2. |
maxK |
Numeric. Maximum number of clusters to try. Must be less than the number of rows in dirtdata. Default is 10. |
nstart |
Numeric. Number of random starts to be used in clustering algorithm. |
plot |
Logical. Should profile cluster plots be generated. Default is TRUE. |
depthticks |
Numeric. Interval for plotting depth. Default is 10. |
minDepth |
Numeric. Minimum depth to be used in plotting. Default is 0. |
maxDepth |
Numeric. Maximum depth to be used in plotting. Default is NULL. |
clusterColors |
Character. Colors to be used in plotting. Default is random soil-like colors. |
profileOrder |
Character. Order in which to plot profiles if multiple soil profiles are present in dirtdata. |
profileName |
Character. If a single profile. What should profile be named? Default is Null. |
plotTitle |
Character. Title for ordination plots. Default is NULL. |
labelOrientation |
Numeric. Controls angle of orientation of axis labels. |
scaleData |
Logical. For Euclidean, should data be scaled prior to clustering. |
weight |
Character. Type of weighting to be used if distance is Gower. See options in gawdis::gawdis. Default is equal to handle NA values. |
groups |
Numeric vector. Vector of trait groupings that are considered to represent related soil information (i.e. L, a, b). By default each trait is treated separately (groups = NULL). In order to define groups use the same values, e.g. groups = c(1,2,2,2,3,3) in case of 6 variables attributed to 3 groups, with the length of vector that should be the same as the number of variables in the dataset. |
A list Containing the data and plots.
Gwen Olivier, Samuel R. Borstein
data("testPit") #Prep data testPit_withMun <- munsling(testPit, munsellCol = "Munsell") testPitM <- testPit_withMun testPitM <- select(testPitM, -c(Munsell) ) #Example using Euclidean distance and PCA EuclidExample <- clastCluster(dirtdata = testPitM, distance = "E", depthStart = "Depth_cm_Start", depthEnd = "Depth_cm_End", profile = "ProfileID", ordination = TRUE, plot = TRUE, maxDepth = 150, depthticks = 10) #Example using Gower's distance and PCoA GowerExample <- clastCluster(dirtdata = testPitM, distance = "G",depthStart = "Depth_cm_Start", depthEnd = "Depth_cm_End", minK = 2, maxK=8, profile = "ProfileID", ordination = TRUE, plot = TRUE, plotTitle="Cluster Analysis of Arroyo Profiles", maxDepth = 150, depthticks = 10, weight = "optimized", groups = c(1,1,1,2,2,3,3,4,5,5,5,5,5,5,5,5,5,5,5,6,6,6))data("testPit") #Prep data testPit_withMun <- munsling(testPit, munsellCol = "Munsell") testPitM <- testPit_withMun testPitM <- select(testPitM, -c(Munsell) ) #Example using Euclidean distance and PCA EuclidExample <- clastCluster(dirtdata = testPitM, distance = "E", depthStart = "Depth_cm_Start", depthEnd = "Depth_cm_End", profile = "ProfileID", ordination = TRUE, plot = TRUE, maxDepth = 150, depthticks = 10) #Example using Gower's distance and PCoA GowerExample <- clastCluster(dirtdata = testPitM, distance = "G",depthStart = "Depth_cm_Start", depthEnd = "Depth_cm_End", minK = 2, maxK=8, profile = "ProfileID", ordination = TRUE, plot = TRUE, plotTitle="Cluster Analysis of Arroyo Profiles", maxDepth = 150, depthticks = 10, weight = "optimized", groups = c(1,1,1,2,2,3,3,4,5,5,5,5,5,5,5,5,5,5,5,6,6,6))
This function saves your soil/sediment pic as a ggplot object, so when you can combine it with other plots in paleoPlot.
groundTruth(imagefile, imageformat = "png", width, height, WHratio)groundTruth(imagefile, imageformat = "png", width, height, WHratio)
imagefile |
Name of file containing a picture of the soils/sediment |
imageformat |
File format of imagefile. Should be either png or jpg. |
width |
Numeric. Width for scaling picture for ggplot plotting |
height |
Numeric. Width for scaling picture for ggplot plotting |
WHratio |
the width to height ratio of your image. tRowel recommends you look up the pixel width and height of the actual image description |
Plot containing selected image to be used in paleoPanel.
Gwen Olivier, Samuel R. Borstein
file_path <- system.file("extdata", "groundTruth.png", package = "tRowel") groundTruth(file_path, imageformat = "png", width = 10, height = 10, WHratio = 1)file_path <- system.file("extdata", "groundTruth.png", package = "tRowel") groundTruth(file_path, imageformat = "png", width = 10, height = 10, WHratio = 1)
Data ffor the Inambari Region from the Amazonian Dark Earths soil dataset of Demetrio et al. (2021).
InambariRegionInambariRegion
A data frame of of 50 rows and 36 columns
ProfileID: Soil profile ID
DepthStart: Sample starting depth in centimeters.
DepthEnd: Sample ending depth in centimeters.
pH1: pH tested using CaCl2.
pH2: pH-SMP.
Alplus3: Exchangeable aluminium (cmolc kg-1).
HplusAl3plus: Exchangeable acidity (cmolc kg-1).
Ca2plus: Exchangeable calcium (cmolc kg-1).
Mg2plus: Exchangeable magnesium (cmolc kg-1).
K: Exchangeable potassium (cmolc kg-1).
SB: Sum of bases (sum of Ca2, Mg2+, K+; cmolc kg-1).
CEC: Cation Exchange Capacity (sum of Al+H, Ca2+, Mg2+,K+; cmolc kg-1).
P: Phosphorus avaliable extracted by Mehlich-1 (mg kg-1).
TotalNitrogen: Total nitrogen.
TotalCarbon: Total carbon.
BaseSaturation: sum of base cations (Ca2+, Mg2+, K+, and Na+).
Ba: Barium content mg kg-1 (pseudototal).
Cd: Cadmium content mg kg-1 (pseudototal).
Cu1: Copper content mg kg-1 (pseudototal).
Fe: Iron content mg kg-1 (pseudototal).
Ni1: Nickel content mg kg-1 (pseudototal).
Pb: Lead content mg kg-1 (pseudototal).
Se: Selenium content mg kg-1 (pseudototal).
Zn: Zinc content mg kg-1 (pseudototal).
Fe_Available: Available Iron mg kg-1.
Zn_Available: Available Zinc mg kg-1.
Mn_Available: Available Manganese mg kg-1.
Cu_Available: Available Copper mg kg-1.
Ni_Available: Available Nickel mg kg-1.
Clay: Clay size (<0.002 mm) particle content (g kg-1).
CoarseSand: Coarse sand size (<2 mm-0.2 mm) particle content (g kg-1).
FineSand: Fine sand size (<0.2 mm-0.053 mm) particle content (g kg-1).
TotalSand: Total sand (CoarseSand+FineSand).
Silt: Silt size (<0.053 mm-0.002 mm) particle content (g kg-1).
MagneticSusceptibility: Magnetic susceptibility of soil.
ApparentElectricalConductivity: Electircal conductivity of soil.
Demetrio WC, Conrado AC, Acioli ANS, Ferreira AC, Bartz MLC, James SW, da Silva E, Maia LS, Martins GC, Macedo RS, Stanton DWG, Lavelle P, Velasquez E, Zangerle A, Barbosa R, Tapia-Coral SC, Muniz AW, Santos A, Ferreira T, Segalla RF, Decaens T, Nadolny HS, Pena-Venegas CP, Maia C, Pasini A, Mota AF, Taube Junior PS, Silva TAC, Rebellato L, de Oliveira Junior RC, Neves EG, Lima HP, Feitosa RM, Vidal Torrado P, McKey D, Clement CR, Shock MP, Teixeira WG, Motta ACV, Melo VF, Dieckow J, Garrastazu MC, Chubatsu LS, Network TPI, Kille P, Brown GG, and Cunha L. 2021. A "Dirty" Footprint: Macroinvertebrate diversity in Amazonian Anthropic Soils. Glob Chang Biol 27:4575–4591. 10.1111/gcb.15752
Plots composition of sand, silt, and clay in soil
loamRanger( dirtdata, depth, sand, silt, sandcolor, siltcolor, claycolor, depth_title = NA, depth_intervals = 10, mindepth = 0, maxdepth = NA, title = NA )loamRanger( dirtdata, depth, sand, silt, sandcolor, siltcolor, claycolor, depth_title = NA, depth_intervals = 10, mindepth = 0, maxdepth = NA, title = NA )
dirtdata |
Dataframe of soil data. |
depth |
Character. Name of column containing starting depth data. |
sand |
Character. Name of column containing sand composition data. |
silt |
Character. Name of column containing silt composition data. |
sandcolor |
Character. Color to represent sand in plot. |
siltcolor |
Character. Color to represent silt in plot. |
claycolor |
Character. Color to represent clay in plot. |
depth_title |
Character. Label for axis representing depth. Default is NA. |
depth_intervals |
Numeric. Interval for plotting depths. This default value of this argument is 10. |
mindepth |
Numeric. Starting depth for the plot. The default value is 0. |
maxdepth |
Numeric. Sets maximum depth for the plot. Default is NA. |
title |
Character. Title to be added to the plot. |
This function plots the composition of soils by the percent representation of clay, silt, and sand. The user needs to specify a dataframe with column names containing the data and then specify the columns that contain the percent composition for sand and silt. Clay is caluclated as the remainder.
A plot of the soil composition with the percent representation of clay, silt, and sand.
Gwen Olivier
# example code data("testPit") testPit2 <- testPit[testPit$ProfileID == "Profile_1",] loamRanger(testPit2, depth = "Depth_cm_Start", sand = "Sand_pct", silt = "Silt_pct", sandcolor = "blue" ,siltcolor = "green", claycolor = "purple", mindepth=0, title = "Texture")# example code data("testPit") testPit2 <- testPit[testPit$ProfileID == "Profile_1",] loamRanger(testPit2, depth = "Depth_cm_Start", sand = "Sand_pct", silt = "Silt_pct", sandcolor = "blue" ,siltcolor = "green", claycolor = "purple", mindepth=0, title = "Texture")
Converts a Munsell specification to CIE Lab coordinates for clustering
munsling(dirtData, munsellCol, whiteVal = "D65")munsling(dirtData, munsellCol, whiteVal = "D65")
dirtData |
A dataframe with a column that has Munsell colors (i.e., 10YR 2/1) |
munsellCol |
The column name with Munsell colors (must be a character and properly formatted (i.e., 10YR 2/1 NOT 10YR2/1) |
whiteVal |
XYZ for the source white - a numeric 3-vector with scaling irrelevant. white can also be a numeric 2-vector; which is interpreted as xy chromaticity and converted to XYZ with Y=100. white can also be the name of any standard illuminant recognized by spacesXYZ::standardXYZ() which is scaled so that Y=100. The default 'D65' is converted to c(95.047,100,108.883). see MunsellToLab::munsellinterpol. |
This function saves the columns to your original dataframe stored in R. Your new df will look the exact same with three new columns (L, a, b). L, a, and b represent the values for CIE colors with L for perceptual lightness and a and b for the four unique colors of human vision.
This function will return the original dataframe with new L, a, b columns
Gwen Olivier, Samuel R. Borstein
data(testPit) MunsellClusterData <- munsling(dirtData = testPit, munsellCol = "Munsell")data(testPit) MunsellClusterData <- munsling(dirtData = testPit, munsellCol = "Munsell")
Plots multiple existing figures/plots to create a panel of figures
paleoPanel( ..., profile = NULL, rows = 1, cols, label_angle = 0, border = FALSE, bordercolor = "darkgrey", marginsize = 0, plotwidths = NULL )paleoPanel( ..., profile = NULL, rows = 1, cols, label_angle = 0, border = FALSE, bordercolor = "darkgrey", marginsize = 0, plotwidths = NULL )
... |
fig. This argument provides unlimited space to upload as many figure/plot names as needed. They plot in the order that they are uploaded. |
profile |
fig. Input the figure name created in groundTruth to add a stratigraphic photo to the front of the panel figure |
rows |
Numeric. Number of rows for the panel figure, defaults to 1 row. |
cols |
Numeric. Number of columns to format the panel figure. If you are using 1 row, make sure this is equal to the number of plots inputted |
label_angle |
Numeric. The angle of X axis labels |
border |
Boolean. If TRUE, the panel figure will have a border |
bordercolor |
Character. If border = TRUE, what color should plotted border be. Default is darkgrey. |
marginsize |
Numeric. Adjusts the margin size between the figures |
plotwidths |
Numeric Vector. Assists in adjusting the spacing when the profile argument is not NA. Input two numbers (i.e., plotwidths = c(1,5)), the first number reflects the width of the profile argument, and the second number reflects the width of panel figures. |
This function plots multiple existing figures/plots to create a multi-figure panel plot. The user needs to upload figure names (with correct y-axis labels [i.e., some may only want the first figure label to have depth]) If adding a profile figure, the groundTruth function must be performed first
A figure that formats multiple plots
Gwen Olivier
#Make groundTruth figure file_path <- system.file("extdata", "groundTruth.png", package = "tRowel") GT.fig <- groundTruth(file_path, imageformat = "png", width = 10, height = 10, WHratio = 1) #Make buriedBar data("testPit") #filter for one profile, in this case profile 5 testPitP5 <- dplyr::filter(testPit, ProfileID == "Profile_5") buriedP5 <- buriedBar(testPitP5, proxies = c("Ca","Mg"),depth = "Depth_cm_Start", measurement_lab = "PPM", max_depth = 140, top_is_zero = TRUE, barcolors = c("blue","green")) #Make terrTrend plot terraP5 <- terraTrend(testPitP5, depth = "Depth_cm_Start", linecolors = c("red","purple"), max_depth = 140, proxies = c("Ca","Mg"), measurement_lab = "PPM",legendtitle = "Elements", depth_lab = "Depth (cm)") #plot with soil picture included paleoPanel(terraP5,buriedP5,cols = 2, profile = GT.fig, plotwidths = c(1,2)) #plot without soil picture included paleoPanel(terraP5,buriedP5,cols = 2)#Make groundTruth figure file_path <- system.file("extdata", "groundTruth.png", package = "tRowel") GT.fig <- groundTruth(file_path, imageformat = "png", width = 10, height = 10, WHratio = 1) #Make buriedBar data("testPit") #filter for one profile, in this case profile 5 testPitP5 <- dplyr::filter(testPit, ProfileID == "Profile_5") buriedP5 <- buriedBar(testPitP5, proxies = c("Ca","Mg"),depth = "Depth_cm_Start", measurement_lab = "PPM", max_depth = 140, top_is_zero = TRUE, barcolors = c("blue","green")) #Make terrTrend plot terraP5 <- terraTrend(testPitP5, depth = "Depth_cm_Start", linecolors = c("red","purple"), max_depth = 140, proxies = c("Ca","Mg"), measurement_lab = "PPM",legendtitle = "Elements", depth_lab = "Depth (cm)") #plot with soil picture included paleoPanel(terraP5,buriedP5,cols = 2, profile = GT.fig, plotwidths = c(1,2)) #plot without soil picture included paleoPanel(terraP5,buriedP5,cols = 2)
Calculate Element Ratios
ratioRustler(df, numerator, denominator, new_col = NULL, removeNAs = TRUE)ratioRustler(df, numerator, denominator, new_col = NULL, removeNAs = TRUE)
df |
A data frame |
numerator |
Vector or list of vectors. Column(s) in the numerator (if user selects multiple columns, the function takes the sum of all columns). If provided as a list, multiple ratios can be calculated. |
denominator |
Vector or list of vectors. Column(s) in the denominator (if user selects multiple columns, the function takes the sum of all columns). If provided as a list, multiple ratios can be calculated. If the denominator value is zero, it'll place an NA |
new_col |
Character. Option to add a name for the new ratio column. If NULL, the function will generate a name. If lists are provided for ratio calculations, new_col must be the same length. Default is NULL (i.e. function generates names for you). |
removeNAs |
Logical - defaults to TRUE (meaning it will remove any NAs from the selected columns) |
A copy of your data frame with the new ratio column. Save the function to a data frame to save the data in your environment (i.e., df_with_ratio <- ratioRustler(df, numerator, denominator))
Gwen Olivier, Samuel R. Borstein
#Example with list input nums <- list(c("Fe","Ca"),"Al", "Si") denoms <- list("K","P",c("Sr","Fe")) data("testPit") ratioRustler(df = testPit, numerator = nums, denominator = denoms, new_col = NULL, removeNAs = TRUE) #Example with vector input while specifying name of new column ratioRustler(df = testPit, numerator = "Fe",denominator = "Ca", new_col = "MyRatio", removeNAs = TRUE)#Example with list input nums <- list(c("Fe","Ca"),"Al", "Si") denoms <- list("K","P",c("Sr","Fe")) data("testPit") ratioRustler(df = testPit, numerator = nums, denominator = denoms, new_col = NULL, removeNAs = TRUE) #Example with vector input while specifying name of new column ratioRustler(df = testPit, numerator = "Fe",denominator = "Ca", new_col = "MyRatio", removeNAs = TRUE)
Plots clastCluster data with landscape elevation
terraceWrangler( clastData, elevData, surfaceElevM, profileClast, profileElev, depthticksM = 1, clusterColors = c("#DCC7AA", "#A68A6D", "#6E5A48", "#D29F6C", "#E8D3A1", "#4F4336", "#AAB8B4", "#4A615D", "#B3A79E", "#8B3A1C", "#C15629"), title = NULL, xLabel = NULL, yLabel = "Depth (m)" )terraceWrangler( clastData, elevData, surfaceElevM, profileClast, profileElev, depthticksM = 1, clusterColors = c("#DCC7AA", "#A68A6D", "#6E5A48", "#D29F6C", "#E8D3A1", "#4F4336", "#AAB8B4", "#4A615D", "#B3A79E", "#8B3A1C", "#C15629"), title = NULL, xLabel = NULL, yLabel = "Depth (m)" )
clastData |
Enter clastCluster data from the saved clastCluster list in environment |
elevData |
Data frame. Name of the df containing Profile Name and Elevation columns |
surfaceElevM |
Name of the column containing elevation (meters only) in elevData |
profileClast |
Name of the profile ID column in clastData |
profileElev |
Name of the profile ID column in elevData |
depthticksM |
Numeric. The displayed numeric intervals of the depth axis, the default is 1 meter |
clusterColors |
Character. Colors to be used in plotting. Default is random soil-like colors. |
title |
Character. Title of plot |
xLabel |
Character. Title of profile axis |
yLabel |
Character. Title of depth axis, the default is "Depth (m)" |
This function plots the data from clastCluster with elevation. You must complete clastCluster before using this function.
A cluster plot demonstrating clusters by depth while including the elevation
Sam Borstein, Gwen Olivier
data("testPit")#load testPit data #Prep data testPit_withMun <- munsling(testPit, munsellCol = "Munsell") testPitM <- testPit_withMun testPitM <- select(testPitM, -c(Munsell) ) #Example using Euclidean distance and PCA EuclidExample <- clastCluster(dirtdata = testPitM, distance = "E", depthStart = "Depth_cm_Start", depthEnd = "Depth_cm_End", profile = "ProfileID", ordination = TRUE, plot = TRUE, maxDepth = 150, depthticks = 10) data(testElevation)# load elevation data #Plot using terraceWrangler to incorporate clustering with elevation terraceWrangler(clastData = EuclidExample$data, elevData = testElevation, surfaceElevM = "surfaceElevM", profileClast = "ProfileID", profileElev = "ProfileID")data("testPit")#load testPit data #Prep data testPit_withMun <- munsling(testPit, munsellCol = "Munsell") testPitM <- testPit_withMun testPitM <- select(testPitM, -c(Munsell) ) #Example using Euclidean distance and PCA EuclidExample <- clastCluster(dirtdata = testPitM, distance = "E", depthStart = "Depth_cm_Start", depthEnd = "Depth_cm_End", profile = "ProfileID", ordination = TRUE, plot = TRUE, maxDepth = 150, depthticks = 10) data(testElevation)# load elevation data #Plot using terraceWrangler to incorporate clustering with elevation terraceWrangler(clastData = EuclidExample$data, elevData = testElevation, surfaceElevM = "surfaceElevM", profileClast = "ProfileID", profileElev = "ProfileID")
Plot proxy trends
terraTrend( dirtdata, depth, title = NULL, linecolors = NA, legendtitle = NA, value_pos = TRUE, legend_pos = TRUE, measurement_lab, depth_lab = NA, depth_axis = TRUE, top_is_zero = TRUE, depth_intervals = 10, min_depth = 0, max_depth, min_measure = NA, max_measure = NA, measure_intervals = NA, proxies )terraTrend( dirtdata, depth, title = NULL, linecolors = NA, legendtitle = NA, value_pos = TRUE, legend_pos = TRUE, measurement_lab, depth_lab = NA, depth_axis = TRUE, top_is_zero = TRUE, depth_intervals = 10, min_depth = 0, max_depth, min_measure = NA, max_measure = NA, measure_intervals = NA, proxies )
dirtdata |
Dataframe of soil/sediment/geologic data. |
depth |
Character. Name of depth column in dirtdata. |
title |
Character. Name for the title of the plot. Default = NULL. |
linecolors |
Character. Specified line colors for the plotted trends. Must be the same length as proxies. Default is NA, in which random colors will be assigned. |
legendtitle |
Character. Name for the title of the legend. Default = NA. |
value_pos |
Logical. This argument is set to TRUE, so the x axis and labels will be at the bottom. If you want it at the top, change it to value_pos = FALSE |
legend_pos |
Logical. This argument is set to TRUE, so it will place the legend at the top. If you want it at bottom, change it to legend_pos = FALSE |
measurement_lab |
Character. Sets the label for the x-axis. |
depth_lab |
Character. This argument is set to NA, so it will put the name of your depth column here. However, if you want to change it you can type depth_lab = “Depth(cm)” or whatever you’d like. |
depth_axis |
Logical. This argument is set to TRUE, so your plot will have the depth label and axis ticks. If you’d like to remove it for a future multipanel plot, then set it to FALSE. |
top_is_zero |
Logical. This argument is set to TRUE, so 0 is at the top of the graph, and max depth is at the bottom. If you’d like to switch it, type top_is_zero = FALSE. |
depth_intervals |
Numeric. Interval for plotting depths. The default value of this argument is 10. |
min_depth |
Numeric. Starting depth for the plot. The default value is 0. |
max_depth |
Numeric. Sets maximum depth for the y axis of the plot. You must provide a value. |
min_measure |
Numeric. Adjusts x-axis minimum number. |
max_measure |
Numeric. Adjusts x-axis maximum number. |
measure_intervals |
Numeric. Adjusts x-axis intervals. |
proxies |
Character. Proxies to be plotted. These should be column names in dirtdata and must match exactly. |
A plot of soil proxy trends.
Gwen Olivier, Samuel R. Borstein
#filter for one profile, in this case profile 5 data(testPit) testPitP5 <- dplyr::filter(testPit, ProfileID == "Profile_5") terraP5 <- terraTrend(testPitP5, depth = "Depth_cm_Start", linecolors = c("red","purple"), max_depth = 140, proxies = c("Ca","Mg"), measurement_lab = "PPM",legendtitle = "Elements", depth_lab = "Depth (cm)")#filter for one profile, in this case profile 5 data(testPit) testPitP5 <- dplyr::filter(testPit, ProfileID == "Profile_5") terraP5 <- terraTrend(testPitP5, depth = "Depth_cm_Start", linecolors = c("red","purple"), max_depth = 140, proxies = c("Ca","Mg"), measurement_lab = "PPM",legendtitle = "Elements", depth_lab = "Depth (cm)")
An example dataset of soil measurements used in examples.
testElevationtestElevation
A data frame of of 5 rows and 2 columns
ProfileID: ID for soil profile.
surfaceElevM: Surface elevation in meters for the profile ID.
An example dataset of soil measurements used in examples.
testPittestPit
A data frame of of 60 rows and 23 columns
SampleID: ID for soil sample.
ProfileID: ID for soil profile.
Depth_cm_Start: Sample starting depth in centimeters.
Depth_cm_End: Sample ending depth in centimeters.
Munsell: Munsell color code.
Sand_pct: Percent sand.
Silt_pct: Percent silt.
Clay_pct: Percent clay.
OrganicC_pct: Percent organics cabon.
Carbonate_pct: Percent carbonate.
d13C: delta thirteen c value.
d15N: delta fifteen n value.
Xlf: Mass-specific low-field AC susceptibility value.
Ca: Calcium value.
Al: Alumninum value.
Si: Silicon value.
K: Potassium value.
Mn: Manganese value.
P: Phosphorus value.
Fe: Iron value.
Sr: Strontium value.
Ti: Titanium value.
Rb: Rubidium value.
Mg: Magnesium value.
An example dataset of qualitative soil measurements used in examples.
testQualtestQual
A data frame of of 22 rows and 11 columns
ProfileID: ID for soil profile.
Depth_cm_Start: Sample starting depth in centimeters.
Depth_cm_End: Sample ending depth in centimeters.
Texture: Categorical classification of soil texture.
Structure: Categorical classification of soil structure.
Size: Categorical classification of soil particle size.
Consistency: Categorical classification of soil Consistency.
Grade: Categorical classification of soil grade.
Carbonates: Categorical classification of soil carbonates.
Roots_rootlets: Categorical classification of soil root/rootlet presence.
Insects_worm_burrows: Categorical classification of insect or worm burrows in soil.