Description Usage Arguments Examples
Save and export plots with the specified names. Use pdf
, bmp
, png
, jpeg
or tiff
to save the plot ouput to the specified directory.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | plot_save(
p,
w = NULL,
h = NULL,
res = 120,
file = NULL,
dir = NULL,
format = "pdf",
show.plot = TRUE,
...
)
pdf_save(p, w = 8, h = 6, file = NULL, dir = NULL, ...)
bmp_save(p, w = 800, h = 600, res = 120, file = NULL, dir = NULL, ...)
png_save(p, w = 800, h = 600, res = 120, file = NULL, dir = NULL, ...)
jpeg_save(p, w = 800, h = 600, res = 120, file = NULL, dir = NULL, ...)
tiff_save(p, w = 800, h = 600, res = 120, file = NULL, dir = NULL, ...)
|
p |
The |
w |
The width of the plot ouput. If |
h |
The height of the plot output. If |
res |
The resolution of the plot ouput. Used if |
file |
The (path and) name of the file (including extention). If |
dir |
The directory to save the plot. If |
format |
The format of the saving file. It can be chose from |
show.plot |
Print the plot at the end of function (boulean). The default is |
... |
Additional arguments passed to the graphic device function specified in |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Load Data
library(pscl)
data(vote92)
## Recode Variables
vote92$voteBush <- as.numeric(
factor(vote92$vote,levels=c("Clinton","Bush")))*1 - 1
vote92$bushdis <- sqrt(vote92$bushdis)
vote92$clintondis <- sqrt(vote92$clintondis)
## Estimate Logistic Regression
fm <- formula(voteBush ~ dem + rep +
clintondis + bushdis +
persfinance + natlecon)
m <- glm(fm, data = vote92,
family = binomial("logit"))
## Basic Graph
p <- plot_coef(m)
p
## Save Graph
plot_save(p)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.