cm2in: Convert centimeters to inches

Description Usage Arguments Details Author(s) Examples

Description

A useful utility function when plotting if, like most in the western world, you have no concept of 'inches'

Usage

1
cm2in(x)

Arguments

x

A numeric (as tested by as.numeric) value to be converted

Details

Uses an approximation of 1 centimeter = 2.54 inches.

Author(s)

Daniel Pritchard

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
cm2in(1) 

cm2in(2.54) 

## Not run: 
# An A4 plot
pdf(file="cms_are_king.pdf", width=cm2in(21.0), height=cm2in(29.7))
plot(x=c(1,2,3), y=(3,2,1))
dev.off()

## End(Not run)

dpritchard/dgmisc documentation built on May 15, 2019, 1:50 p.m.