utils_image | R Documentation |
Import images from files and URLs and write images to files, possibly with batch processing.
image_import(
img,
...,
which = 1,
pattern = NULL,
path = NULL,
resize = FALSE,
plot = FALSE,
nrow = NULL,
ncol = NULL
)
image_export(img, name, prefix = "", extension = NULL, subfolder = NULL, ...)
image_pliman(img, plot = FALSE)
img |
|
... |
Alternative arguments passed to the corresponding functions from
the |
which |
logical scalar or integer vector to indicate which image are
imported if a TIFF files is informed. Defaults to |
pattern |
A pattern of file name used to identify images to be imported.
For example, if |
path |
A character vector of full path names; the default corresponds to
the working directory, |
resize |
Resize the image after importation? Defaults to |
plot |
Plots the image after importing? Defaults to |
nrow, ncol |
Passed on to |
name |
An string specifying the name of the image. It can be either a character with the image name (e.g., "img1") or name and extension (e.g., "img1.jpg"). If none file extension is provided, the image will be saved as a *.jpg file. |
prefix |
A prefix to include in the image name when exporting a list of
images. Defaults to |
extension |
When |
subfolder |
Optional character string indicating a subfolder within the current working directory to save the image(s). If the folder doesn't exist, it will be created. |
image_import()
returns a new Image
object.
image_export()
returns an invisible vector of file names.
image_pliman()
returns a new Image
object with the example image
required. If an empty call is used, the path to the tmp_images
directory
installed with the package is returned.
Tiago Olivoto tiagoolivoto@gmail.com
library(pliman)
folder <- image_pliman()
full_path <- paste0(folder, "/sev_leaf.jpg")
(path <- file_dir(full_path))
(file <- basename(full_path))
image_import(img = full_path)
image_import(img = file, path = path)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.