Soft Non-numeric Occurrence Estimation (SNOE) plot
Usage
snoe_plot(
x,
codes = ".*",
matchRegexAgainstPaths = TRUE,
estimateWithin = NULL,
title = "SNOE plot",
ggplot2Theme = ggplot2::theme_minimal(),
greyScale = FALSE,
colors = c("#0072B2", "#C0C0C0"),
greyScaleColors = c("#808080", "#C0C0C0"),
silent = rock::opts$get("silent")
)
Arguments
- x
A parsed source(s) object.
- codes
A regular expression to select codes to include, or, alternatively, a character vector with literal code idenfitiers.
- matchRegexAgainstPaths
Whether to match the
codes
regular expression against the full code paths or only against the code identifier.- estimateWithin
The column specifying within what to count.
- title
Title of the plot
- ggplot2Theme
Can be used to specify theme elements for the plot.
- greyScale
Whether to produce the plot in color (
FALSE
) or greyscale (TRUE
).- colors, greyScaleColors
The (two) colors to use for the color and greyscale versions of the SNOE plot.
- silent
Whether to be chatty or silent
Examples
### Get path to example source
examplePath <-
system.file("extdata", package="rock");
### Get a path to one example file
exampleFile <-
file.path(examplePath, "example-3.rock");
### Load example source
loadedExample <- rock::parse_source(exampleFile);
### Show code occurrence estimates
rock::snoe_plot(
loadedExample
);
### Load two example sources
loadedExamples <- rock::parse_sources(
examplePath,
regex = "example-[34].rock"
);
rock::snoe_plot(
loadedExamples
);