nplot: Create and Save 'nice R plot'/'nicer plot' as Png, Pdf, Jpg...

View source: R/nplot.R

nplotR Documentation

Create and Save 'nice R plot'/'nicer plot' as Png, Pdf, Jpg and/or Svg

Description

Plots data stored in a data.frame, james object, matrix, mts, ts, cbs.nl-type 'share data' URL, an xlsx-file or in a list that combines these data structures. The result is saved as PNG, PDF, SVG, and/or JPEG.

Usage

nplot(x, ...)

Arguments

x

data.frame, james object, matrix, mts, ts, 'path/to/file.xlsx', URL

...

you can add parameters to customize your figure (see manual). For example 'title' to specify a title, 'pdf = TRUE' if you want a PDF ('png = TRUE' by default), and 'file' to specify file name (with path/to/your-file.{png, pdf, jpg, svg} as a result).

Details

Class 'james' can help you to recycle parameters and data across multiple figures. A 'james' object also enables you also to add parameters in an incremental fashion, rather than putting them all in one big nplot-statement. The name 'nplot' is a contraction of 'n(icer)plot', which can exist next to R's regular plot-function.

Value

path/to/result/file.png

See Also

james to create a james object

Examples

## Not run: 
x <- 0:6
d <- data.frame(x, first = (6 - x)^2, second = x^2)
nplot(d, title = 'Hello World', x_title = 'x', y_title = 'y', footnote = "just an example")

## End(Not run)

data-science-made-easy/nicerplot documentation built on Nov. 3, 2024, 9:23 p.m.