Creates a ggplot2 object of the gene summaries
calculated by summarize_gene()
Usage
# S3 method for class 'hagis.gene.summary'
autoplot(object, type, color = NULL, order = NULL, ...)
Arguments
- object
a
hagis.gene.summary
object generated bysummarize_gene()
.Character
.- type
a vector of values for which the bar plot is desired. Specify whether to return a graph of the percent pathogenic isolates,
percentage
, or as the count,count
.Character
.- color
a named or hexadecimal color value to use for the bar color
- order
sort the x-axis of the bar chart by ascending or descending order of
N_virulent_isolates
orpercent_pathogenic
. Acceptsascending
ordescending
input values. Defaults togene
name.Character
.- ...
passed to the chosen
geom(s)
Value
A ggplot2 plot
Examples
if (FALSE) { # interactive()
# Using the built-in data set, `P_sojae_survey`
data(P_sojae_survey)
# calculate susceptibilities with a 60 % cutoff value
susc <- summarize_gene(x = P_sojae_survey,
cutoff = 60,
control = "susceptible",
sample = "Isolate",
gene = "Rps",
perc_susc = "perc.susc")
# Visualize the summary of genes
autoplot(susc, type = "percentage")
}