gg3logit: Create a new gg3logit

gg3logitR Documentation

Create a new gg3logit

Description

gg3logit initialises a ggplot object through ggtern. If a field3logit or a multifield3logit object is passed to argument data, the mandatory aesthetics of the ternary plot are automatically set. See \insertCitesanti2022;textualplot3logit for details and examples.

Usage

gg3logit(data = NULL, mapping = aes(), ...)

Arguments

data

a field3logit object, a multifield3logit object, or a data.frame structured like a fortified field3logit or a multifield3logit object.

mapping

list of aesthetic mappings to be used for plot. If a field3logit or a multifield3logit is passed to data, none of the aesthetics mappings listed in section Aesthetic mappings below has to be specified (if specified, they will be overwritten).

...

additional arguments passed through to ggtern.

Aesthetic mappings

The following aesthetics are required by at least one of the available stats. None of them should be specified if a field3logit or a multifield3logit is passed to the argument data of gg3logit(), stat_field3logit() or stat_conf3logit():

  • x, y, z are required by:

    • stat_field3logit() as ternary coordinates of the starting points of the arrows;

    • stat_conf3logit() ternary coordinates of the points on the border of confidence regions;

  • xend, yend, zend: required by stat_field3logit() as ternary coordinates of the ending points of the arrows;

  • group: identifier of groups of graphical objects (arrows and their confidence regions);

  • type: type of graphical object (arrows or confidence regions).

The following variables of a fortified field3logit or a multifield3logit object may be useful for defining other standard aesthetics (such as fill, colour, ...):

  • label identifies a field through a label, thus it is useful for distinguishing the fields in a multifield3logit object.

  • idarrow identifies each group of graphical objects (arrows and their confidence regions) within every field. Unlike variable group, idarrow is not a global identifier of graphical objects.

See Also

Other gg functions: autoplot.Hfield3logit(), stat_3logit(), stat_conf3logit(), stat_field3logit()

Examples

## Not run: 
data(cross_1year)

mod0 <- nnet::multinom(employment_sit ~ gender + finalgrade, data = cross_1year)
field0 <- field3logit(mod0, 'genderFemale')

gg3logit(field0) + stat_field3logit()

## End(Not run)


plot3logit documentation built on July 19, 2022, 9:07 a.m.