plot_code | R Documentation |
This function creates the code in text needed for reproducing a plot from explore.
plot_code(
filename,
fulldata,
selection = seq_len(nrow(fulldata)),
x,
y,
color = "lightblue",
pal = "Set1"
)
filename |
The filename (preferably the full path) for the data used. |
fulldata |
The data.frame with the original full data displayed in explore. |
selection |
An integer vector of the rows of the |
x |
A variable name in |
y |
A variable name in |
color |
A color to use in the plots that have one single color. |
pal |
A color palette to use with brewer.pal for the mosaic plots when 'x' and 'y' are factors. |
A character vector with the code to reproduce a figure.
Leonardo Collado-Torres
cat(plot_code("mtcars.csv", mtcars, x = "mpg", selection = 1:5))
cat(plot_code("mtcars.csv", mtcars, x = "mpg", y = "vs"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.