Description Usage Arguments Details Author(s) Examples
Saves a plot in the directory chosen at the beginning of the current Hugo Investigation in the subfolder 'gallery' in .rda file with miniatures in pdf and png, what makes plot easier to search
1 | hugo_memorise_plot(plot = NA, name = NULL)
|
plot |
plot to be saved, created with package graphics or ggplot2 |
name |
character string, name of plot, if NULL then plots will be saved as "plot" with next numbers |
When plot to save is created with more then one funkction from package graphics, the whole block of code should be putted to the function in bracket '...'.
Joanna Golawska
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
# saving plot created with package graphics with a given name
hugo_memorise_plot(plot(1:10), "nice_plot")
# saving plot created with package graphics without argument name
hugo_memorise_plot(plot(1:10, las = 1))
# if plot is created with more then one function from package graphics
hugo_memorise_plot({plot(1:10)
abline(a = 1, b = 1)})
# creating and saving plot with ggplot2
df <- data.frame(gp = factor(rep(letters[1:3], each = 10)),y = rnorm(30))
require(ggplot2)
plot_gg <- ggplot(df, aes(gp, y)) + geom_point()
hugo_memorise_plot(plot_gg, "plot_with_ggplot")
# also works:
hugo_memorise_plot(ggplot(df, aes(gp, y)) + geom_point())
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.