Package: ggdiagram 0.2.0

ggdiagram: Object-Oriented Diagram Plots with 'ggplot2'

Creates diagrams with an object-oriented approach. Geometric objects have computed properties with information about themselves (e.g., their area) or about their relationships with other objects (e.g, the distance between their edges). The objects have methods to convert them to geoms that can be plotted in 'ggplot2'.

Authors:W. Joel Schneider [aut, cre]

ggdiagram_0.2.0.tar.gz
ggdiagram_0.2.0.zip(r-4.7)ggdiagram_0.2.0.zip(r-4.6)ggdiagram_0.2.0.zip(r-4.5)
ggdiagram_0.2.0.tgz(r-4.6-any)ggdiagram_0.2.0.tgz(r-4.5-any)
ggdiagram_0.2.0.tar.gz(r-4.7-any)ggdiagram_0.2.0.tar.gz(r-4.6-any)
ggdiagram_0.2.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
ggdiagram/json (API)
NEWS

# Install 'ggdiagram' in R:
install.packages('ggdiagram', repos = c('https://wjschne.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/wjschne/ggdiagram/issues

Pkgdown/docs site:https://wjschne.github.io

On CRAN:

Conda:

diagramsfactor-analysisggplot2path-analysiss7structural-equation-modelingquarto

7.54 score 57 stars 87 scripts 578 downloads 71 exports 71 dependencies

Last updated from:0d0977dfb4. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK339
source / vignettesOK292
linux-release-x86_64OK367
macos-release-arm64OK246
macos-oldrel-arm64OK224
windows-develOK355
windows-releaseOK323
windows-oldrelOK326
wasm-releaseOK159

Exports:%-|%%>%%|-%arrowheadas.geombindcircle_from_3_pointsclass_colorconnectdata2shapedegreedistanceequationget_depthget_tibbleget_tibble_defaultsggdiagraminsideintersectionintersection_anglelabel_objectlag_cyclelatex_colorlead_cyclemap_obmap2_obmean_colormidpointnudgeob_angleob_arcob_arrayob_bezierob_circleob_circular_segmentob_covarianceob_ellipseob_interceptob_labelob_latexob_lineob_ngonob_pathob_pointob_polarob_polygonob_rectangleob_reuleauxob_segmentob_shape_listob_styleob_varianceob_wedgeplacepolar2justprojectionproppropsradianredefaultrescaleresectrotateround_probabilityset_default_arrowheadset_propssigns_centeredsubscriptsuperscriptturnunbind

Dependencies:arrowheadraskpassbase64encbezierchkclicommonmarkcpp11curldplyrfarvergenericsgeomtextpathggarrowggforceggplot2ggtextgluegridtextgtablehmsisobandjanitorjpegjsonlitelabelinglavaanlifecyclelitedownlubridatemagickmagrittrmarkdownMASSmnormtnumDerivpbivnormpdftoolspillarpkgconfigpngpolyclippurrrqpdfquadprogR6RColorBrewerRcpprlangS7scalessignssnakecasestringistringrsyssystemfontstextshapingtibbletidyrtidyselecttimechangetintertinytextweenrutf8vctrsviridisLitewithrxfunxml2

Using ggdiagram

Rendered fromggdiagram.qmdusingquarto::htmlon May 26 2026.

Last update: 2026-04-29
Started: 2025-03-23

Readme and manuals

Help Manual

Help pageTopics
Return default arrowheadarrowhead set_default_arrowhead
as.geom functionas.geom
bind methodbind
Get a circle from 3 pointscircle_from_3_points
color classclass_color
Arrow connect one shape to anotherconnect
Make shapes from datadata2shape
Calculate distance between 2 pointsdistance
equationequation
Function to calculate hierarchy depth in lavaan modelsget_depth
Get object data with styles in a tibbleget_tibble get_tibble_defaults
ggdiagram functionggdiagram
is an ob_point inside a shape ?inside
intersection of 2 objects (e.g., lines)intersection
Compute the angle of the intersection of two objectsintersection_angle
Automatic label for objectslabel_object
Surround TeX expression with a color commandlatex_color
Finds the "previous" (lag) or "next" (lead) values in a vector or object with values at the end of the vector recycled to the beginning.lag_cycle lead_cycle
Map over a ggdiagram objectmap_ob
Map over two ggdiagram objectsmap2_ob
Average across colorsmean_color
Get one or more points at positions from 0 to 1midpoint
Move an objectnudge
ob_angledegree ob_angle radian turn
ob_arc classob_arc ob_circular_segment ob_wedge
Object Arraysob_array
The ob_bezier (i.e., bezier curve) classob_bezier
ob_circle classob_circle
Covariance objectob_covariance
ob_ellipse classob_ellipse
ob_interceptob_intercept
ob_label classob_label
ob_latex classob_latex
ob_line classob_line
The ob_ngon (regular polygon) classob_ngon
The ob_path classob_path
ob_pointob_point ob_polar
The ob_polygon classob_polygon
ob_rectangle classob_rectangle
Reuleaux polygonob_reuleaux
ob_segment classob_segment
ob_shape_listob_shape_list
ob_style classob_style
Variance objectob_variance
Find point perpendicular to 2 points%-|% %|-% perpendicular_horizontal perpendicular_point perpendicular_vertical
Place an object a specified distance from another objectplace
Convert hjust and vjust parameters from polar coordinatespolar2just
Find projection of a point on an object (e.g., line or segment)projection
Make a variant of a function with alternate defaultsredefault
Rescale an object in 2 dimensionsrescale
resectresect
Rotate an object in 2 dimensionsrotate
Probability roundinground_probability
Centering signed numberssigns_centered
Create subscriptssubscript superscript
unbindunbind