Package pathdiagram. R topics documented: August 29, 2016

Similar documents
Introduction to pathdiagram

Package EnQuireR. R topics documented: February 19, Type Package Title A package dedicated to questionnaires Version 0.

Package Grid2Polygons

Package waterfall. R topics documented: February 15, Type Package. Version Date Title Waterfall Charts in R

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package pairsd3. R topics documented: August 29, Title D3 Scatterplot Matrices Version 0.1.0

Package docxtools. July 6, 2018

Graphics in R STAT 133. Gaston Sanchez. Department of Statistics, UC Berkeley

Package desplot. R topics documented: April 3, 2018

Package sankey. R topics documented: October 22, 2017

Package qboxplot. November 12, qboxplot... 1 qboxplot.stats Index 5. Quantile-Based Boxplots

Package sciplot. February 15, 2013

Package meme. November 2, 2017

Package gridextra. September 9, 2017

Package svglite. September 11, 2017

Package lvm4net. R topics documented: August 29, Title Latent Variable Models for Networks

Package memery. February 13, 2018

Package Mondrian. R topics documented: March 4, Type Package

Package ECctmc. May 1, 2018

Package pca3d. February 17, 2017

Package ggrepel. September 30, 2017

Package rvg. February 13, 2018

Package munfold. R topics documented: February 8, Type Package. Title Metric Unfolding. Version Date Author Martin Elff

Package multigraph. R topics documented: January 24, 2017

Package meme. December 6, 2017

Package gridgraphics

Plotting Complex Figures Using R. Simon Andrews v

Package R2SWF. R topics documented: February 15, Version 0.4. Title Convert R Graphics to Flash Animations. Date

Package showtextdb. R topics documented: September 11, 2017

Package beanplot. R topics documented: February 19, Type Package

Package wordcloud. August 24, 2018

Package scatterd3. March 10, 2018

Graphics - Part III: Basic Graphics Continued

Package panelview. April 24, 2018

Package multigraph. R topics documented: November 1, 2017

Package weco. May 4, 2018

Package RYoudaoTranslate

Package grimport. R topics documented: February 20, 2015

Class IX Mathematics (Ex. 3.1) Questions

Package NetWeaver. January 11, 2017

Package cowplot. March 6, 2016

Package qrfactor. February 20, 2015

Unit 5 Test 2 MCC5.G.1 StudyGuide/Homework Sheet

Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

The nor1mix Package. August 3, 2006

Package canvasxpress

Package d3heatmap. February 1, 2018

Package cairodevice. August 29, 2013

Package customlayout

Package mixphm. July 23, 2015

Package hextri. April 22, 2016

Package reval. May 26, 2015

Package explor. R topics documented: October 10, Type Package Title Interactive Interfaces for Results Exploration Version 0.3.

Package hpoplot. R topics documented: December 14, 2015

Package qicharts. October 7, 2014

Package ggimage. R topics documented: December 5, Title Use Image in 'ggplot2' Version 0.1.0

Generating Vectors Overview

Package MeanShift. R topics documented: August 29, 2016

Package barcoder. October 26, 2018

JASCO CANVAS PROGRAM OPERATION MANUAL

Package horizon. R topics documented: July 3, Type Package Title Horizon Search Algorithm Version 1.2 Date Author Jasper Van doninck

Package Numero. November 24, 2018

DC2 File Format. 1. Header line 2. Entity line 3. Point line 4. String line

Package comphclust. February 15, 2013

Package rtsplot. September 15, 2018

February 13, notebook

Package comphclust. May 4, 2017

Package Combine. R topics documented: September 4, Type Package Title Game-Theoretic Probability Combination Version 1.

Package rgho. R topics documented: January 18, 2017

Package VennDiagram. February 15, 2013

Package fastdummies. January 8, 2018

Exercise (3.1) Question 1: How will you describe the position of a table lamp on your study table to another person?

WORD Creating Objects: Tables, Charts and More

Package xroi. February 13, 2019

Package gains. September 12, 2017

DinoCapture Additional Software Instructions for Measurement models

5.6 Exercises. Section 5.6 Optimization Find the exact maximum value of the function f(x) = x 2 3x.

Clipping Algorithms; 8-5. Computer Graphics. Spring CS4815

The nor1mix Package. June 12, 2007

Package replicatedpp2w

Package arphit. March 28, 2019

Package ClustGeo. R topics documented: July 14, Type Package

Package VennDiagram. April 16, 2013

Solution Notes. COMP 151: Terms Test

Package shinyfeedback

Package spark. July 21, 2017

Drill Table. Summary. Modified by Phil Loughhead on 16-Jun Parent page: PCB Dialogs

Package preprosim. July 26, 2016

Package ggimage. R topics documented: November 1, Title Use Image in 'ggplot2' Version 0.0.7

Package WordR. September 7, 2017

Graphics #1. R Graphics Fundamentals & Scatter Plots

Package sizemat. October 19, 2018

Package gridgraphviz

Package grimport2. March 20, 2018

Package blandr. July 29, 2017

Name: Pythagorean Theorem February 3, 2014

Package splines2. June 14, 2018

Package readmzxmldata

Package ggmosaic. February 9, 2017

Package SSRA. August 22, 2016

Transcription:

Type Package Title Basic functions for drawing path diagrams Version 0.1.9 Date 2013-07-28 Author Package pathdiagram August 29, 2016 Maintainer <gaston.stat@gmail.com> Implementation of simple functions to draw basic path diagrams just for visualization purposes. URL http://www.gastonsanchez.com Depends R (>= 3.0), shape Suggests knitr VignetteBuilder knitr License GPL-3 Collate 'arrow.r' 'draw.r' 'latent.r' 'manifest.r' 'wall.r' NeedsCompilation no Repository CRAN Date/Publication 2013-07-29 19:57:33 R topics documented: arrow............................................ 2 draw............................................. 3 latent............................................ 4 manifest........................................... 6 wall............................................. 7 Index 9 1

2 arrow arrow Plot arrow between variables Use this function to draw connecting arrows between manifest and latent variables. from to arrow(from, to, start = "east", end = "west", length = 0.1, angle = 10, code = 2, col = "#d2def1", lwd = 3,...) An object of either class "manifest" or "latent". This object is the origin of the arrow. An object of either class "manifest" or "latent". This object is the destination of the arrow. start Character string to specify the starting direction of the arrow. Options are "north", "south", "east", "west". end length angle code col lwd Character string to specify the ending direction of the arrow. Options are "north", "south", "east", "west". length of the edges of the arrow head (in inches). angle from the shaft of the arrow to the edge of the arrow head. integer code, determining kind of arrows to be drawn. color of the arrow. width of the arrow.... other arguments passed on to arrows. manifest, latent, draw # latent variables attack = latent("attack", x=0.35, y=0.7, rx=0.08, ry=0.06) defense = latent("defense", x=0.35, y=0.3, rx=0.08, ry=0.06) success = latent("success", x=0.65, y=0.5, rx=0.08, ry=0.06)

draw 3 # open wall # draw latent variables draw(attack) draw(defense) draw(success) # add arrows arrow(from=attack, to=success, start="east", end="west") arrow(from=defense, to=success, start="east", end="west") draw Draw manifest and latent variables Use this function to draw either manifest or latent variables on a plot. draw(obj) obj An object of either class "manifest" or "latent" manifest, latent # manifest variables ingredients = list( eggs = manifest("eggs", x=0.3, y=0.7, width=0.10, height=0.08), milk = manifest("milk", x=0.3, y=0.6, width=0.10, height=0.08), flour = manifest("flour", x=0.3, y=0.5, width=0.10, height=0.08), sugar = manifest("sugar", x=0.3, y=0.4, width=0.10, height=0.08), butter = manifest("butter", x=0.3, y=0.3, width=0.10, height=0.08) ) # latent variables pancakes = latent("pancakes", x=0.6, y=0.6, rx=0.09, ry=0.07)

4 latent waffles = latent("waffles", x=0.6, y=0.4, rx=0.09, ry=0.07) # open wall title("toy Path Diagram", col.main="gray20") # draw manifest variables for (i in 1:length(ingredients)) { draw(ingredients[[i]]) } # draw latent variables draw(pancakes) draw(waffles) # draw arrows for (i in 1:length(ingredients)) { arrow(from=ingredients[[i]], to=pancakes, start="east", end="west") arrow(from=ingredients[[i]], to=waffles, start="east", end="west") } latent Set specifications of a latent variable Use this function to specify the graphic characteristics of a latent variable. The specifications will be used by the function draw to plot latent variables (in a path diagram). latent(label = "latent", x = 0.5, y = 0.5, rx = 0.05, ry = 0.05, border = "white", lwd = 2, fill = "#5f8bd7", col = "white", cex = 1, vfont = NULL, font = 2, family = "sans") label x y rx ry border lwd fill A character string with the label to be displayed. x-axis coordinate for center of ellipse. y-axis coordinate for center of ellipse. long radius of ellipse. short radius of ellipse. color of the border. width of border line. color to fill the ellipse

latent 5 col cex vfont font color of the label. numeric character expansion of the label. font family of the label. An integer specifying which font to use for the label. See par family The name of a font family for drawing text. Standard values are "serif", "sans" and "mono". Details Latent variables are drawn as ellipses using the function plotellipse Value An object of class "latent", which is a list with the specified parameters to draw latent variables. manifest, draw # latent variables attack = latent("attack", x=0.35, y=0.7, rx=0.08, ry=0.06) defense = latent("defense", x=0.35, y=0.3, rx=0.08, ry=0.06) success = latent("success", x=0.65, y=0.5, rx=0.08, ry=0.06) # opwn wall title("drawing three latent variables", col.main="gray20") # draw variables draw(attack) draw(defense) draw(success)

6 manifest manifest Set specifications of a manifest variable Use this function to specify the graphic characteristics of a manifest variable. The specifications will be used by the function draw to plot manifest variables (in a path diagram). manifest(label = "manifest", x = 0.5, y = 0.5, width = NULL, height = 0.1, border = "white", fill = "#9dbafa", lwd = 1, col = "gray20", cex = 1, vfont = NULL, font = 1, family = "sans") label x y width height border fill lwd col cex vfont font Details Value A character string with the label to be displayed. x-axis coordinate for center of rectanlge. y-axis coordinate for center of rectangle. width of the rectangle. height of the rectangle. color of the border. color to fill the rectangle. width of the border. color of the label. numeric character expansion of the label. font family of the label. An integer specifying which font to use for the label. See par family The name of a font family for drawing text. Standard values are "serif", "sans" and "mono". Manifest variables are drawn as rectangles. An object of class "manifest", which is a list with the specified parameters to draw manifest variables.

wall 7 latent, draw # manifest variables eggs = manifest("eggs", x=0.3, y=0.7, width=null, height=0.08) milk = manifest("milk", x=0.4, y=0.6, width=null, height=0.08) flour = manifest("flour", x=0.5, y=0.5, width=null, height=0.08) sugar = manifest("sugar", x=0.6, y=0.4, width=null, height=0.08) butter = manifest("butter", x=0.7, y=0.3, width=null, height=0.08) # open wall title("five manifest variables", col.main="gray20") # draw manifest variables draw(eggs) draw(milk) draw(flour) draw(sugar) draw(butter) wall Open a new frame for a path diagram Use this function to open a white canvas to start drawing a path diagram. By default, wall opens a new plot window from 0 to 1 in both axes. wall(xlim = c(0, 1), ylim = c(0, 1), xpd = TRUE,...) xlim Numeric vector of length 2 giving the x coordinate range. Default xlim = c(0, 1). ylim Numeric vector of length 2 giving the y coordinate range. Default ylim = c(0, 1). xpd Logical value to indicate if all plotting is clipped to the figure region. The default is c(1, 1, 1, 1).... other graphical arguments passed on to plot.window.

8 wall Details wall calls plot.new() and plot.window() to open a new plot frame. manifest, latent, draw # latent variables attack = latent("attack", x=0.35, y=0.7, rx=0.08, ry=0.06) defense = latent("defense", x=0.35, y=0.3, rx=0.08, ry=0.06) success = latent("success", x=0.65, y=0.5, rx=0.08, ry=0.06) # open diagram # draw latent variables draw(attack) draw(defense) draw(success) # add arrows arrow(from=attack, to=success, start="east", end="west") arrow(from=defense, to=success, start="east", end="west")

Index arrow, 2 draw, 2, 3, 5, 7, 8 latent, 2, 3, 4, 7, 8 manifest, 2, 3, 5, 6, 8 par, 5, 6 plot.window, 7 plotellipse, 5 wall, 7 9