summary_plot | R Documentation |
Adds a secondary scale for strat.plot
summary_plot( x, g, yvar, xLeft = 0.8, xRight = 1, y.axis = FALSE, ylabel = "", cex.ylabel = 1, x.name.pos, srt.xlabel = 90, cex.xlabel = 1, fill )
x |
a stratigraphic diagram object produced by strat.plot. |
g |
matrix or data.frame with summary groups. Column names will be used as labels. |
yvar |
y variable. Same as main plot. |
xLeft |
Position of plot. See |
xRight |
ditto |
y.axis |
ditto |
ylabel |
ditto |
cex.ylabel |
ditto |
x.name.pos |
numeric. Position of names. Defaults to midpoint of uppermost sample. |
srt.xlabel |
See |
cex.xlabel |
ditto |
fill |
vector of colours. Defaults to RcolourBrewer Set1 |
secondary.scale
library(rioja) library(dplyr) data(RLGH) fos <- RLGH$spec chron <- RLGH$depths groups <- case_when( substr(names(fos), 1, 1) %in% c("A", "E") ~ "Vowel", substr(names(fos), 1, 1) %in% c("B", "C", "F") ~ "BCF", TRUE ~ "NPT" ) %>% factor(levels = c("Vowel", "BCF", "NPT")) g <- sapply(levels(groups), function(lev){ rowSums(fos[, groups == lev, drop = FALSE]) }) pt <- strat.plot(fos, yvar = chron$Depth, y.rev = TRUE, xLeft = .1, xRight = 0.8, scale.percent = TRUE) summary_plot(pt, g = g, yvar = chron$Depth, xLeft = 0.8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.