| plot.garrett | R Documentation |
Produces graphical representations of Garrett ranking results.
## S3 method for class 'garrett'
plot(
x,
type = c("bar", "lollipop", "dot", "line", "heatmap", "cluster", "contribution"),
top = NULL,
color = "#2C7FB8",
label = TRUE,
point_size = 3,
line_size = 1,
cluster_rows = TRUE,
cluster_cols = FALSE,
distance = "euclidean",
clustering_method = "complete",
scale = "none",
show_numbers = FALSE,
...
)
x |
An object of class |
type |
Type of plot. Options are |
top |
Number of top-ranked factors to display. Default is |
color |
Colour used for ranking plots. |
label |
Logical. Should Garrett scores be displayed as labels? |
point_size |
Size of points used in dot, lollipop, and line plots. |
line_size |
Width of lines used in lollipop and line plots. |
cluster_rows |
Logical. Should factors be hierarchically clustered in cluster plots? |
cluster_cols |
Logical. Should ranks be hierarchically clustered? |
distance |
Distance measure used for hierarchical clustering. |
clustering_method |
Method used for hierarchical clustering. |
scale |
Should heatmap data be scaled by rows, columns, or not
scaled? Options are |
show_numbers |
Logical. Should matrix values be displayed inside heatmap cells? |
... |
Additional arguments passed to |
For "bar", "lollipop", "dot", and
"line" plots, a ggplot object. For "heatmap",
"cluster", and "contribution" plots, a pheatmap
object returned invisibly. The returned object contains the graphical
representation of the Garrett ranking results.
data(garrett_example)
result <- garrett_rank(garrett_example,respondent = "Respondent")
#Select the plot type
plot(result, type = "bar")
plot(result, type = "lollipop")
plot(result, type = "dot")
plot(result, type = "line")
plot(result, type = "heatmap")
plot(result, type = "cluster")
plot(result,type="contribution")
plot(result, type = "cluster", k = 3)
plot(result,type = "cluster",scale = "row",show_numbers = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.