Publications by R | datawookie

{blogdown}: Optimise PNG Image Size

20.02.2021

Inspired by the informative post from Jumping Rivers about selecting the correct image file type, I decided to optimise PNG file size as part of this blog’s CI pipeline. OptiPNG As suggested, I used optipng. Let’s see how well this works on a large sample PNG file. $ optipng moon.png ** Processing: moon.png 8192x4096 pixels, 3x8 bits/pixel,...

1414 sym R (624 sym/2 pcs) 2 img

{emayili:0.4.6} Attachments with UTF-8 Filenames & Setting Sender

07.03.2021

Two new features in the {emayili} (0.4.6) package for easily sending emails from R. Package Setup If you have not already installed the package, then grab it from CRAN or GitHub. # From CRAN. install.packages("emayili") # From GitHub. remotes::install_github("datawookie/emayili") Load the package. library(emayili) Check that you have the current...

1726 sym R (2923 sym/10 pcs) 4 img

An Environment for Reliably Rendering Figures in R

22.03.2021

Fathom Data is working on a project to reproduce the figures from the CORE textbook The Economy using R and {ggplot2}. There’s a strict style guide which specifies the figure aesthetics including colours and font. We’re a team of seven people working on as many different setups. The principle challenges have been package versions and fonts. ...

2623 sym R (1266 sym/4 pcs) 2 img

Making the Most of Mobility

01.04.2021

I became aware of the Community Mobility Reports data courtesy of this tweet from Mike Schussler: Next time someone tells you that people are misbehaving you can tell the the data says no they are listening doing as they are told. Data from our mobile phones shows we staying away from retail, restaurants, transit parks etc, We have spent far more...

3993 sym R (1679 sym/5 pcs) 12 img

The Easter Bunny is Cashing In

02.04.2021

Has the price of Easter Eggs shot up since last year? Let’s use data from Trundler to investigate. I’ll do the analysis in R using the {trundler} package. Data Preparation I’ve already got a collection of product IDs stashed in PRODUCT_ID. We need to find the associated product information and prices. egg_products <- map_df(PRODUCT_ID, pro...

2755 sym R (293 sym/3 pcs) 16 img

{hagr} Database of Animal Ageing and Longevity

11.04.2021

I came across the Human Ageing Genomic Resources. They are doing some fascinating work and expose some engrossing data. I wanted to make the data easier for me to work with, and an R package seemed to be the natural vehicle to do this. For more information on these data, take a look at this article: Tacutu, Craig, Budovsky, Wuttke, Lehmann, Taran...

3613 sym R (2584 sym/9 pcs) 12 img

{hagr} Linnaean Classification

15.04.2021

I’ve taken another look at the {hagr} data, which I wrote about previously. This time I’m focusing on the hierarchy of creatures. Taxonomic Rank The Linnaean Taxonomy is a hierarchical classification system for organisms devised by Carl Linnaeus. An organism is assigned to the following levels in the hierarchy (in increasing order or granula...

2557 sym R (3123 sym/9 pcs) 4 img

Using {pagedown} in Docker

27.05.2021

I’m building an automated reporting system which generates PDF reports. My approach is to use R Markdown to write the report and render to PDF using the excellent {pagedown} package. Ultimately the system needs to be packaged in Docker and deployed in the cloud. Setup To illustrate what I’m doing, we’ll use a simple dummy document, test.Rm...

3649 sym R (1650 sym/10 pcs) 4 img

Shiny Inception: JavaScript in Rendered Markdown

02.06.2021

I’m busy helping a colleague with a Shiny application. The application includes HTML content rendered from a .Rmd document. However, there’s a catch: the .Rmd uses the {DT} package to render a dynamic DataTable. It turns out that this doesn’t immediately work because the JavaScript in the embedded document isn’t run. I’ll use a simple d...

2105 sym R (1466 sym/3 pcs) 10 img

Shiny on ECS

23.06.2021

A recipe for setting up a simple Shiny app on ECS. Docker Image ? If you want to simply use my Docker image for testing, then you can skip this section and go straight to deploying. Since this is for illustration purposes, I’m going to keep the app itself super simple, just using a slightly modified version of the “Old Faithful Geyser Data�...

2555 sym R (261 sym/3 pcs) 8 img