coord_nested: Coord Nested

Description Usage Arguments Details Value See Also Examples

View source: R/coord_nested.R

Description

Generates coordinates for a nested chart and all other charts.

Usage

1
2
3
4
5
coord_nested(data, subradius, rotate_radians = 0, rotate_degrees = 0,
  subrotate_radians = 0, subrotate_degrees = 0, rotate_title_radians = 0,
  rotate_title_degrees = 0, prepare_item_charts = FALSE,
  correlations = TRUE, cor_spacing = 0.4, relative_scaling = 3,
  xarrows = NULL)

Arguments

data

list generated by input_excel, or by hand, containing formatted data.

subradius

integer; (arbitrary) radius of the circles representing facets (same unit as center distances), use to avoid circle overlap and optimize appearance.

rotate_radians

integer; radian angle to rotate the chart counter-clockwise by; use fractions of pi (e.g. pi/2 = 90 degrees).

rotate_degrees

integer; angle in degrees to rotate the chart counter-clockwise by.

subrotate_radians

integer; radian angle or vector of radian angles to rotate the nested facet charts counter-clockwise by; use fractions of pi (e.g. pi/2 = 90 degrees).

subrotate_degrees

integer; angle in degrees or vector of angles in degrees to rotate the nested facet charts counter-clockwise by.

rotate_title_radians

integer; radian angle to rotate the global label counter-clockwise by; use fractions of pi (e.g. pi/2 = 90 degrees).

rotate_title_degrees

integer; angle in degrees to rotate the global label counter-clockwise by.

prepare_item_charts

logical; if TRUE, generates coordinates for item charts for all factors by calling coord_items.

correlations

logical; if TRUE, generates coordinates for latent correlations between tests and sets up a ring to draw them in. If FALSE, the ring and the correlations are omitted, simplifying the chart significantly.

cor_spacing

integer; if correlations = TRUE: width of the ring the latent correlations between tests are drawn in; defaults to 0.4.

relative_scaling

integer; relative size of the global chart compared to the nested facet charts; defaults to 3.

xarrows

data frame containing information about additional correlation arrows between facets of different tests; see examples.

Details

Use this function in conjunction with plot_nested for nested models.

Use nested_chart to create the chart in a single step.

The following changes to the chart appearance are made using this function, not plot_nested:

This function also provides coordinates for facet charts and item charts (if prepare_item_charts = TRUE) You can use it in conjunction with plot_facets or plot_items.

If you set subrotate to a single value, all nested facet charts will be rotated by the same amount. If you use a vector of values, the nested facet charts will be rotated one by one by the values from that vector.

Increase relative_scaling to avoid circle overlap. Decrease it to make small chart objects more visible.

correlations and cor_spacing add larger circles around the nested facet charts, but do not change these facet charts.

Value

List containing coordinates of chart objects.

See Also

plot_nested nested_chart

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# # creating nested charts is a two step process, using this function and
# # plot_nested:
# coord <- coord_nested(self_confidence, subradius = .6)
# sc_nested <- plot_nested(coord, filename = "sc_nested")
# sc_nested
#
# # adding xarrows
# sc_arrows <- data.frame(test1 = rep(NA, 3),
#                          facet1 = NA,
#                         test2 = NA,
#                          facet2 = NA,
#                         value = NA)
# sc_arrows[1, ] <- c("DSSEI", "Ab", "RSES", "Ps", ".67")
# sc_arrows[2, ] <- c("DSSEI", "Ab", "SMTQ", "Cs", ".81")
# sc_arrows[3, ] <- c("SMTQ", "Ct", "RSES", "Ns", ".76")
# coord <- coord_nested(self_confidence,
#                        subradius = .6,
#                        xarrows = sc_arrows)
# sc_nested <- plot_nested(coord, filename = "sc_nested", show_xarrows = TRUE)
# sc_nested
#
# # rotating the nested facet charts one by one
# coord <- coord_nested(self_confidence,
#                        subradius = .6,
#                        subrotate_radians = c(0, pi / 2, 0))
#  sc_nested <- plot_nested(coord, filename = "sc_nested")
#  sc_nested

NilsPetras/IPV documentation built on Dec. 7, 2018, 8:55 a.m.