pkgndep (version 1.0.0)

plot.pkgndep: Plot method

Description

Plot method

Usage

# S3 method for pkgndep
plot(x, pkg_fontsize = 10, title_fontsize = 12, legend_fontsize = 8,
    fix_size = !dev.interactive(), ...)

Arguments

x

The object from pkgndep.

pkg_fontsize

Fontsize for the package names.

title_fontsize

Fontsize for the titles.

legend_fontsize

Fontsize for the legends.

fix_size

Should the rows and columns in the heatmap have fixed size?

...

Other arguments.

Value

A length-tow unit object which corresponds to the width and height of the plot.

Details

If fix_size is set to TRUE. The size of the whole plot can be obtained by:

    size = plot(x, fix_size = TRUE)  

where size is a unit object with the width and height of the whole heatmap, in unit mm. If you want to save the plot in to e.g. a PDF file that has the same size of the heatmap, you need to make the plot twice. First save the plot into a null device, just to obtain the size of the plot:

    pdf(NULL) # a null device
    size = plot(x, fix_size = TRUE)
    dev.off()
    width = convertX(size[1], "inches", valueOnly = TRUE)
    height = convertY(size[2], "inches", valueOnly = TRUE)
    pdf(..., width = width, height = height)
    plot(x)
    dev.off()  

If there are no dependency packages stored in x, NULL is returned.

Examples

Run this code
# NOT RUN {
# See examples in `pkgndep()`.
# }

Run the code above in your browser using DataLab