The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Change the unit of figure size

By default, R Markdown employs inch as a unit of figure size. You can change it by hook_figure_unit.

CAUTIONS

Basic usage

hook_figure_unit() changes to the unit of figure size to millimeters. Note that this hook will not change the default size.

library(chunkhooks)
hook_figure_unit()
#> fig.retina is set NULL
# fig.width=50, fig.height=50 (50mm * 50mm)
plot(1)

Other units

You may change default unit by the first argument, unit.

hook_figure_unit("cm")

Choices are followings:

measurements::conv_unit_options$length
#>  [1] "angstrom"   "nm"         "um"         "mm"         "cm"        
#>  [6] "dm"         "m"          "km"         "inch"       "ft"        
#> [11] "foot"       "feet"       "yd"         "yard"       "fathom"    
#> [16] "mi"         "mile"       "naut_mi"    "au"         "light_yr"  
#> [21] "light_year" "parsec"     "point"

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.