item_chart: Item Chart

View source: R/item_chart.R

item_chartR Documentation

Item Chart

Description

Creates an item chart, showing the items of a test arranged by facets.

Usage

item_chart(
  data,
  test = NULL,
  facet_order = NULL,
  file_name = "none",
  size = 1,
  font = "sans",
  rotate_radians = 0,
  rotate_degrees = 0,
  grid_limit = 0,
  file_width = 12,
  file_height = 10,
  zoom_x = NULL,
  zoom_y = NULL,
  dpi = 500,
  color = "black",
  color2 = "black",
  fade_axes = 50,
  fade_grid_major = 15,
  fade_grid_minor = 65,
  dodge = 1,
  dist_test_label = 0.5,
  rotate_test_label_radians = 0,
  rotate_test_label_degrees = 0,
  width_items = 1,
  length_items = 1,
  length_ratio_items = 1.5,
  title = NULL,
  size_title = 1,
  size_tick_label = 1,
  size_test_label = 1,
  size_facet_labels = 1,
  width_axes = 1,
  size_arrow_heads = 1,
  width_grid = 1
)

Arguments

data

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

test

character; name of the test to plot, "all" plots the global level of a nested case, sorting all items by test; defaults to the first in the list.

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'.

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.

grid_limit

integer; upper limit to which the grid lines should be drawn; defaults to 0, in which case an appropriate value is estimated.

file_width

integer; file width in inches; defaults to 12.

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

first accent color; defaults to "black".

color2

second accent color; defaults to "black".

fade_axes

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

fade_grid_major

integer; brightness of the gray tone of the major grid lines between 0 = "black" and 100 = "white" in steps of 1; defaults to 15.

fade_grid_minor

integer; brightness of the gray tone of the minor grid lines between 0 = "black" and 100 = "white" in steps of 1; defaults to 65.

dodge

integer; horizontal outward dodge of facet labels relative to default.

dist_test_label

integer; position of the test label relative to the surrounding circle; defaults to .5, in which case the test label is displayed halfway 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 test label counter-clockwise by.

width_items

integer; item bar width relative to default.

length_items

integer; item bar length relative to default.

length_ratio_items

integer; relative item bar length; defaults to 1.5.

title

character; overall chart title; defaults to NULL.

size_title

integer; title font size relative to default.

size_tick_label

integer; axis tick label font size relative to default.

size_test_label

integer; test label font size relative to default.

size_facet_labels

integer; facet label font size relative to default.

width_axes

integer; radial axis width relative to default.

size_arrow_heads

integer; arrow head size relative to default.

width_grid

integer; grid line width relative to default.

Details

When changing the size of objects, consider the size parameter first and make specific adjustments with the other size_ and width_ parameters after.

To better display overlapping item values, change the width of the item bars, or set the accent colors to different values, or change the ratio of item lengths.

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.

Using a grid_limit higher than the default will re-scale the whole chart, while a value below the default will only remove grid lines.

Value

Object of the class "ggplot" and, by default, the same object saved as a file.

See Also

facet_chart nested_chart

Examples

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


NilsPetras/IPV documentation built on July 19, 2023, 9:12 p.m.