Stat Tech
https://stattech.wordpress.fos.auckland.ac.nz
Statistics Technical BlogMon, 06 Jan 2020 01:30:58 +0000en-US
hourly
1 http://blogs.auckland.ac.nz/?v=5.3.2https://stattech.wordpress.fos.auckland.ac.nz/files/2016/12/cropped-stat-tech-150x150.pngStat Tech
https://stattech.wordpress.fos.auckland.ac.nz
32322020-01 Visual Testing for Graphics in R
https://stattech.wordpress.fos.auckland.ac.nz/2020/01/06/2020-01-visual-testing-for-graphics-in-r/
Mon, 06 Jan 2020 01:30:58 +0000http://stattech.blogs.auckland.ac.nz/?p=449 ...]]>This report describes the ‘gdiff’ package for R, which provides tools for performing visual tests on graphical output. Visual testing is essential for checking that code is producing the correct graphical output. The goal of the ‘gdiff’ package is to support a wide range of testing scenarios, including testing graphical output between different versions of R.

]]>2019-02 SVG In, SVG Out
https://stattech.wordpress.fos.auckland.ac.nz/2019/11/25/2019-02-svg-in-svg-out/
Mon, 25 Nov 2019 02:03:18 +0000http://stattech.blogs.auckland.ac.nz/?p=447 ...]]>This report discusses how to work with complex SVG images in R. We look at importing an external SVG image into R with the ‘grImport2’ package, integrating the imported image with other R graphics, such as plots, and exporting the result to an external SVG image with the ‘gridSVG’ package. We discuss some of the complications that can arise with this workflow and show that Version 0.2-0 of the ‘grImport2’ package helps to deal with those complications.

]]>2019-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.