facet_chart: Facet Chart

View source: R/facet_chart.R

facet_chartR Documentation

Facet Chart

Description

Creates a facet chart, showing the facets of a test.

Usage

facet_chart(
  data,
  test = NULL,
  cd_method = "aggregate",
  facet_order = NULL,
  subradius = 0,
  file_name = "none",
  size = 1,
  font = "sans",
  rotate_radians = 0,
  rotate_degrees = 0,
  file_width = 10,
  file_height = 10,
  zoom_x = NULL,
  zoom_y = NULL,
  dpi = 500,
  color = "#007AD6",
  fade = 85,
  tick = 0,
  rotate_tick_label = 0,
  cor_labels = TRUE,
  dist_test_label = 2/3,
  rotate_test_label_radians = 0,
  rotate_test_label_degrees = 0,
  title = NULL,
  size_title = 1,
  size_cor_labels = 1,
  size_test_label = 1,
  size_facet_labels = 1,
  width_axes = 1,
  width_circles = 1,
  width_tick = 1,
  size_tick_label = 1,
  size_marker = 0.1
)

Arguments

data

Object of class IPV as created by the function 'ipv_est'

test

character; name of the test to plot; defaults to the first in the list.

cd_method

character; method to summarize center distances, either "mean" or "aggregate", see details; defaults to "aggregate".

facet_order

character; vector of facet names in desired order (counter-clockwise); defaults to NULL, in which case the order is based on the correlation matrix columns in 'data'.

subradius

integer; same unit as center distances; radius of the facet circles; defaults to 0, in which case an appropriate value is estimated.

file_name

character; name of the file to save. Supported formats are: "pdf" (highest quality and smallest file size), "png", "jpeg"; defaults to "none".

size

integer; changes the size of most chart objects simultaneously.

font

character; text font, use extrafonts to access additional fonts; defaults to "sans", which is "Helvetica".

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.

file_width

integer; file width in inches; defaults to 10.

file_height

integer; file height in inches; defaults to 10.

zoom_x

integer; vector with two values, the edges of the zoomed section on the x-axis; defaults to NULL.

zoom_y

integer; vector with two values, the edges of the zoomed section on the y-axis; defaults to NULL.

dpi

integer; resolution in dots per inch for "png" and "jpeg" files; defaults to 500.

color

accent color; defaults to blue ("#007AD6").

fade

integer; brightness of the gray tones between 0 = "black" and 100 = "white" in steps of 1; defaults to 85.

tick

numeric; axis tick position; defaults to 0, in which case an appropriate value is estimated.

rotate_tick_label

numeric; number of positions to move the tick label (counter-clockwise); defaults to 0.

cor_labels

logical; if TRUE, shows latent correlations between facets; defaults to TRUE.

dist_test_label

integer; position of the test label relative to the surrounding circle; defaults to 2/3, in which case the test label is displayed 2/3 of the way from the center to the surrounding circle.

rotate_test_label_radians

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

rotate_test_label_degrees

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

title

character; overall chart title; defaults to NULL.

size_title

integer; title font size relative to default.

size_cor_labels

integer; correlation font size relative to default.

size_test_label

integer; test font size relative to default.

size_facet_labels

integer; facet font size relative to default.

width_axes

integer; radial axis width relative to default.

width_circles

integer; facet circle outline width relative to default.

width_tick

integer; axis tick line width relative to default.

size_tick_label

integer; axis tick font size relative to default.

size_marker

integer; size (in inches) of the value marker at the circle border that indicates the center distance, a value of 0 omits the marker; defaults to .1

Details

To summarize center distances (cd_method), the "mean" method computes the average center distance (compute cds first, summarize across items second), while the "aggregate" method computes a center distance based on the sum of the squared loadings (summarize across items first, compute cds second). "Aggregate" (default) is recommended, because it is more meaningful in cases with heterogeneous factor loadings, while "mean" is the originally proposed method.

Pdf files will be vector based and can be scaled arbitrarily. For other formats use file_width, file_height, and dpi to avoid later rescaling and loss of quality.

Instead of using screenshots to crop the chart, it is highly recommendable to use zoom_x and zoom_y. This allows for vector-based graphics quality when showing sections of the chart. With this cropping method, use file_width to set the overall size of the file output, file_height will automatically adjust to retain the correct aspect ratio, if both zoom_x and zoom_y are provided.

Consider adding title and caption in your typesetting software (LaTeX, MS Word, ...), not here. The option to add a title is only a quick and dirty shurtcut. It reduces chart size and is inflexible. Adding the title manually will provide additional options, but requires you to save to a file manually. To manually add a title or caption use labs.

Value

Object of the class "ggplot".

See Also

item_chart nested_chart

Examples

# as simple as that:
facet_chart(self_confidence, test = "SMTQ")


IPV documentation built on Sept. 30, 2022, 5:08 p.m.