Stat Tech
https://stattech.wordpress.fos.auckland.ac.nz
Statistics Technical Blog
Tue, 05 Mar 2019 19:25:48 +0000 en-US
hourly
1 http://blogs.auckland.ac.nz/?v=5.1.1https://stattech.wordpress.fos.auckland.ac.nz/files/2016/12/cropped-stat-tech-150x150.pngStat Tech
https://stattech.wordpress.fos.auckland.ac.nz
32322019-01 A Geometry Engine Interface for ‘grid’
https://stattech.wordpress.fos.auckland.ac.nz/2019/03/04/2019-01-a-geometry-engine-interface-for-grid/
Mon, 04 Mar 2019 01:49:31 +0000http://stattech.blogs.auckland.ac.nz/?p=443 ...]]>This report describes a new function in ‘grid’ called grobCoords and a new package called ‘gridGeometry’ that combines grobCoords with the ‘polyclip’ package to provide a geometry engine interface for ‘grid’.

]]>2018-13 Rendering HTML Content in R Graphics
https://stattech.wordpress.fos.auckland.ac.nz/2018/12/17/2018-13-rendering-html-content-in-r-graphics/
Sun, 16 Dec 2018 23:23:14 +0000http://stattech.blogs.auckland.ac.nz/?p=441 ...]]>This report describes several R packages that allow HTML content to be rendered as part of an R plot. The core package is called ‘layoutEngine’, but that package requires a “backend” package to perform HTML layout calculations. Three example backends are demonstrated: ‘layoutEngineCSSBox’, ‘layoutEnginePhantomJS’, and ‘layoutEngineDOM’. We also introduce two new font packages, ‘gyre’ and ‘courier’.

]]>2018-12 MetaPost Three Ways
https://stattech.wordpress.fos.auckland.ac.nz/2018/12/03/2018-12-metapost-three-ways/
Sun, 02 Dec 2018 20:04:19 +0000http://stattech.blogs.auckland.ac.nz/?p=439 ...]]>This report describes three different approaches to communicating between R and MetaPost: importing the PostScript output from MetaPost with the ‘grImport’ package; calling the mpost program to solve MetaPost paths with the ‘metapost’ package; and calling the mplib library to solve MetaPost paths with the ‘mplib’ package.

]]>2018-11 Variable-Width Bezier Splines in R
https://stattech.wordpress.fos.auckland.ac.nz/2018/11/02/2018-11-variable-width-bezier-splines-in-r/
Thu, 01 Nov 2018 22:58:12 +0000http://stattech.blogs.auckland.ac.nz/?p=437 ...]]>This report describes support for a new type of variable-width line in the ‘vwline’ package for R that is based on Bezier curves. There is also a new function for specifying the width of a variable-width line based on Bezier curves and there is a new linejoin and lineend style, called “extend”, that is available when both the line and the width of the line are based on Bezier curves. This report also introduces a small ‘gridBezier’ package for drawing Bezier curves in R.

]]>2018-10 Building an mplib Shared Library
https://stattech.wordpress.fos.auckland.ac.nz/2018/10/04/2018-10-building-an-mplib-shared-library/
Wed, 03 Oct 2018 23:36:42 +0000http://stattech.blogs.auckland.ac.nz/?p=435This report records the steps that were used to build a shared library for the MetaPost graphics system.

]]>2018-09 Importing General-Purpose Graphics in R
https://stattech.wordpress.fos.auckland.ac.nz/2018/09/20/2018-09-importing-general-purpose-graphics-in-r/
Wed, 19 Sep 2018 21:19:21 +0000http://stattech.blogs.auckland.ac.nz/?p=433 ...]]>This report discusses some problems that can arise when attempting to import PostScript images into R, when the PostScript image contains coordinate transformations that skew the image. There is a description of some new features in the ‘grImport’ package for R that allow these sorts of images to be imported into R successfully.

]]>2018-08 Revisiting Mathematical Equations in R: The ‘dvir’ package
https://stattech.wordpress.fos.auckland.ac.nz/2018/08/31/2018-08-revisiting-mathematical-equations-in-r-the-dvir-package/
Thu, 30 Aug 2018 22:18:33 +0000http://stattech.blogs.auckland.ac.nz/?p=431 ...]]>This report describes an R package called ‘dvir’ that aims to use TeX as a layout engine, but performs all rendering within R. The package reads DVI files that are produced from TeX files and renders the content using the R package ‘grid’.

]]>2018-07 Echoes of the Future
https://stattech.wordpress.fos.auckland.ac.nz/2018/07/20/2018-07-echoes-of-the-future/
Thu, 19 Jul 2018 22:38:34 +0000http://stattech.blogs.auckland.ac.nz/?p=429 ...]]>This report discusses ways to combine graphics output from the ‘graphics’ package and the ‘grid’ package in R and introduces a new function echoGrob in the ‘gridGraphics’ package.

]]>2018-06 Rasterizing Chromatograms
https://stattech.wordpress.fos.auckland.ac.nz/2018/06/13/2018-06-rasterizing-chromatograms/
Wed, 13 Jun 2018 03:03:55 +0000http://stattech.blogs.auckland.ac.nz/?p=427 ...]]>This report describes an application of the ‘rasterize’ package for R. We rasterize (just) the line segments of two chromatograms in order to render one semi-transparently over the other. This also demonstrates, more generally, the value of having access to advanced graphical techniques within statistical graphics software.

]]>2018-05 Selective Raster Graphics
https://stattech.wordpress.fos.auckland.ac.nz/2018/05/25/2018-05-selective-raster-graphics/
Thu, 24 May 2018 21:57:46 +0000http://stattech.blogs.auckland.ac.nz/?p=425 ...]]>This report explores ways to render specific components of an R plot in raster format, when the overall format of the plot is vector. For example, we demonstrate ways to draw raster data symbols within a PDF scatter plot. A general solution is provided by the grid.rasterize function from the R package ‘rasterize’.