qplot_spStat.Rd
Plot a summary of spectroscopic data in hyperSpec object by group.
The summary statistic internally is generated by either function
spStat
or aggregate
.
qplot_spStat(
sp,
by = stop("Argument 'by' is missing."),
FUN = stop("Argument 'FUN' is missing."),
Title = fCap(as.character(match.call()$FUN)),
subTitle = NULL,
All = FALSE,
fixed.colors = All,
All.color = "black",
gr.color = c(hyGet_palette(sp), RColorBrewer::brewer.pal(8, "Dark2")),
All.linetype = "dashed",
gr.linetype = "solid",
All.size = 1.1,
gr.size = 0.8,
legend.title = element_blank(),
...,
add = FALSE
)
layer_spStat(
sp,
by = stop("Argument 'by' is missing."),
FUN = stop("Argument 'FUN' is missing."),
Title = fCap(as.character(match.call()$FUN)),
subTitle = NULL,
All = FALSE,
...,
add = TRUE
)
Spectroscopic data
(either a hyperSpec
object or a matrix).
A grouping variable (either a vector or a variable name in sp
).
A function that calculates one or several summary statistics.
The main title of the plot.
The second line of title, which will be smaller and and in italics.
Logical. If TRUE
, plot additional curve for a statistic
of all spectra (.ALL
), not divided to groups.
- Logical. If TRUE
, color scheme where
.ALL
is plotted as a black line is be used.
A line color for .ALL
.
Line colors (a vector) for each level in by
.
A line type for .ALL
.
Line types (a vector) for each level in by
.
A line width for .ALL
.
Line widths (a vector) for each level in by
.
A title for legend. Default is no title.
A ggplot
object.
More details in package ggplot2.
Other spHelper plots:
check_palette()
,
layer_spRangeMean()
,
plot_colors()
,
plot_hyPalette()
,
plot_spCompare()
,
plot_spDiff()
,
plot_spDistribution()
,
qplot_confusion()
,
qplot_crosstab()
,
qplot_infoDim()
,
qplot_kAmp()
,
qplot_kSp()
,
qplot_prediction()
,
qplot_spRangeCenter()
,
qplot_spRangeMedian()
,
qplot_spc()
,
rmExpr()
,
rm_stripes()
,
stat_chull()
qplot_spStat(chondro,"clusters",mean)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'nrow': object 'chondro' not found
qplot_spStat(chondro,"clusters",mean,All=FALSE)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'nrow': object 'chondro' not found
qplot_spStat(chondro,"clusters",mean_sd,All=FALSE) + facet_grid(.~clusters)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'nrow': object 'chondro' not found
qplot_spStat(chondro,"clusters",median,All=FALSE, fixed.colors=FALSE)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'nrow': object 'chondro' not found
qplot_spStat(chondro,"clusters",median, "My Title")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'nrow': object 'chondro' not found
# Make facets with fewer ticks on the x axis:
qplot_spStat(chondro,"clusters",mean_pm_sd) +
facet_grid(.~clusters) +
nTick_x(2)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'nrow': object 'chondro' not found
# Add as a layer:
qplot_spRange(chondro, "clusters") +
layer_spStat(chondro,"clusters", mean, size = 1)
#> Error in hyGet_palette0(sp): object 'chondro' not found