Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

save_plot

Saves a SEMinR model plot to file


Description

Saves a SEMinR model plot to a graphical file. Default output is RPlots.pdf.

Usage

save_plot(
  filename = "RPlot.pdf",
  plot = last_seminr_plot(),
  width = NULL,
  height = NULL
)

Arguments

filename

The name of the file output (can be png, pdf, webp, ps, or svg.)

plot

A plot that is created from the plot function. By default it uses the last plot created.

width

An optional parameter for width in pixels.

height

An optional parameter for height in pixels.

Value

Does not return a value

Examples

mobi <- mobi

# seminr syntax for creating measurement model
mobi_mm <- constructs(
             reflective("Image",        multi_items("IMAG", 1:5)),
             reflective("Expectation",  multi_items("CUEX", 1:3)),
             reflective("Quality",      multi_items("PERQ", 1:7)),
             reflective("Value",        multi_items("PERV", 1:2)),
             reflective("Satisfaction", multi_items("CUSA", 1:3)),
             reflective("Complaints",   single_item("CUSCO")),
             reflective("Loyalty",      multi_items("CUSL", 1:3))
           )
# seminr syntax for creating structural model
mobi_sm <- relationships(
  paths(from = "Image",        to = c("Expectation", "Satisfaction", "Loyalty")),
  paths(from = "Expectation",  to = c("Quality", "Value", "Satisfaction")),
  paths(from = "Quality",      to = c("Value", "Satisfaction")),
  paths(from = "Value",        to = c("Satisfaction")),
  paths(from = "Satisfaction", to = c("Complaints", "Loyalty")),
  paths(from = "Complaints",   to = "Loyalty")
)

# estimate the model
mobi_pls <- estimate_pls(data = mobi,
                         measurement_model = mobi_mm,
                         structural_model = mobi_sm)
## Not run: 
# generate the plot
plot(mobi_pls)
# save to file
save_plot("myplot.pdf")

## End(Not run)

seminr

Building and Estimating Structural Equation Models

v2.0.2
GPL-3
Authors
Soumya Ray [aut, ths], Nicholas Patrick Danks [aut, cre], André Calero Valdez [aut], Juan Manuel Velasquez Estrada [ctb], James Uanhoro [ctb], Johannes Nakayama [ctb], Lilian Koyan [ctb], Laura Burbach [ctb], Arturo Heynar Cano Bejar [ctb], Susanne Adler [ctb]
Initial release
2021-04-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.