plot_resphist: Alternative plotting function for Aldrich-McKelvel Results

View source: R/asmcjr.r

plot_resphistR Documentation

Alternative plotting function for Aldrich-McKelvel Results

Description

Uses ggplot2 to produce alternative visualizations for results of the aldmck or blackboxfunctions.

Usage

plot_resphist(result, groupVar = NULL, facetVar = NULL, addStim = FALSE,
    scaleDensity=TRUE, weights = c("all", "positive", "negative"),
    xlab = NULL, main = NULL, ylab = NULL, whichRes = NULL,
    dim = NULL, ...)

Arguments

result

An object of class aldmck that is the result of an Aldrich-McKelvey scaling analysis.

groupVar

Optional grouping variable that will paritition the observations to produce different density cuvres for aldmck results.

facetVar

An optional variable on which to facet the results

addStim

Logical indicating whether the stimulus locations should be added to the density plot.

scaleDensity

Logical indicating whether density should be scaled to represent different proportions of observations by group.

weights

Which observations should be used in plotting. The default is to use all available observations. The "positive" and "negative" options allow users to plot only those observations with either positive or negative weights, respectively.

xlab

Optional x-label for the plot.

main

Optional main title for the plot.

ylab

Optional y-label for the plot.

whichRes

For objects of class blackbox, an integer identifying the dimension of the solution used for plotting. If NULL (the default), the algorithm chooses the solution with the smallest dimensionality that can accommodate the request. For example, if dim=2, then the two-dimensional solution would be chosen if whichRes is NULL.

dim

For object os class blackbox, an integer identifying the dimension desired for plotting.

...

Other arguments to be passed down, currently unimplemented.

Value

A ggplot of the stimulus locations and density of ideal points.

See Also

aldmck


davidaarmstrong/asmcjr documentation built on June 29, 2024, 12:07 p.m.