rbloggers
Posts for rbloggers feed.

Making headlines
Using the headliner package for data driven ggplot titles Continue reading Making headlines

On target
A beginners introduction to getting started with the targets package in R Continue reading On target

Exploring your database with shiny
Programatically querying a database with flexible SQL queries and visualising the results with shiny. Continue reading Exploring your database with shiny

Iterating over multiple database tables with the tidyverse
Extracting data from multiple database tables with dplyr and purrr. Continue reading Iterating over multiple database tables with the tidyverse

Dynamic SQL queries with R
Programmatic querying with dynamic schema, table and column names. Continue reading Dynamic SQL queries with R

Dual axis charts in ggplot2 - why they can be useful and how to make them
Create Pareto charts in ggplot2 with custom legends using manual scales and ggtext Continue reading Dual axis charts in ggplot2 - why they can be useful and how to make them

Separate SQL
Why you should consider keeping your SQL queries in a separate file. Continue reading Separate SQL

Inverness street maps
Ticking off the rstats bucket list - emulating Taras Kaduk’s street map - but in a Highland stylee with OSM, sf and ggdark Continue reading Inverness street maps

UK Energy company acquisitions - a great use case for Sankey plots
Sankey plots are the ideal chart type to plot the flow of customers from collapsing energy companies. Here’s how to prepare your data with dplyr, before plotting with networkD3 Continue reading UK Energy company acquisitions - a great use case for Sankey plots

Reactable Rocks!
Make engaging tables in R with {reactable} and {reactablefmtr} Continue reading Reactable Rocks!

I got my first package onto CRAN, and YOU CAN TOO
If I can do it, so can you. Feel the fear, do the checks, go for it. Here are some tips and links to help you get your package onto CRAN. Continue reading I got my first package onto CRAN, and YOU CAN TOO

Shooting Stars
Why you should consider starring repos on GitHub. Continue reading Shooting Stars

cusumcharter available on CRAN
Introducing the cusumcharter package which makes it easier to create and plot CUSUM control charts. Continue reading cusumcharter available on CRAN

Scheduling Rmarkdown files on Windows - your foolproof guide
Scheduling an Rmarkdown script can be tricky - there are a few issues that are not always obvious. Here’s how to run yours successfully Continue reading Scheduling Rmarkdown files on Windows - your foolproof guide

Passing parameters to SQL Server functions using R
How to parameterise an input into the SQL Server DATEADD function, via R. Useful when you want to pass an integer somewhere deep inside your SQL query Continue reading Passing parameters to SQL Server functions using R

fwf without the faff
Fixed width files aren’t too common, but they don’t have to be scary. readr comes to the rescue with read_fwf() Continue reading fwf without the faff

Calculating hotel occupancy with R
Putting patientcounter to the test by calculating hotel occupancy. Continue reading Calculating hotel occupancy with R

Well Well Well my Excel
I’m fed up forgetting how to combine lots of excel workbooks into one dataframe, so I’m documenting several ways of doing it, using purrr, data.table, rio and base R. Continue reading Well Well Well my Excel

Cutting down code in dplyr and data.table
Do we have to sacrifice readability for brevity? data.table allows succinct code, but so does tidyverse. data.table has some extra tricks up it’s sleeve though. Continue reading Cutting down code in dplyr and data.table

Introducing popthemes
Introducing another set of palettes and scales for ggplot2, based on pop album covers. Continue reading Introducing popthemes

Some data.table tips
Rolling joins, wrapping functions around regular DT[] calls, and more. Continue reading Some data.table tips

PreppinData - accepting the challenge with R and PowerBI
I’ve completed a month of ‘PreppinData’ challenges, using both R and PowerBI. Some things have been easy, some have not - here’s what I’ve learned in Week 1 Continue reading PreppinData - accepting the challenge with R and PowerBI

demystifying the coalesce function
coalesce is a one of those functions that might not strike you as being very useful, mainly because it doesn’t sound very exciting. But it IS useful, and might save you some time and complexity Continue reading demystifying the coalesce function

collapse might rock your world
collapse is a new force in the data transformation stakes. In this post, I try out one simple function and compare it to data.table and dplyr Continue reading collapse might rock your world

NHS-R Community Conference 2020
The 3rd Annual NHS-R Community Conference went virtual, and was an amazing success. Although I missed plenty, I saw more than enough good stuff to know that this is my team. And, everything’s online for catch up. Yay! Continue reading NHS-R Community Conference 2020

Getting started with network plots
Network plots can be hit or miss. For those of us used to tables or dataframes, the terminology is confusing. They often don’t look good. However, the visNetwork package changes all that as it greatly simplifies the process of producing useful, interactive network plots. Continue reading Getting started with network plots

metallicaRt
Seek and Destroy meets School of Rock as a new Metallica inspired colour pallete package hits the streets (in the city tonight) Continue reading metallicaRt

Rapid Analysis and Presentation of Quality Improvement Data with R
I presented at RMedicine2020 and really enjoyed it Continue reading Rapid Analysis and Presentation of Quality Improvement Data with R

Solving small data problems with data.table
Friday afternoon fun - how do we do we filter this data, combining elements from different rows and discarding NA values? Continue reading Solving small data problems with data.table

SIMD Revisited
Visualising the 2020 Scottish Index of Multiple Deprivation data using beewswarm plots, scatter plots and alternative ggplot2 themes and palettes. Continue reading SIMD Revisited

patientcounter
Introducing the patientcounter package for counting how many patients are in hospital at any point in time Continue reading patientcounter
Programming with data.table
getting started with multiple bare variable names in data.table functions. Continue reading Programming with data.table
data.table by a dummy - a dummies guide
A dummies guide to the fabulous data.table package, for new users to get up to speed quickly Continue reading data.table by a dummy - a dummies guide

gganimation for the nation
gganimate is now on CRAN so taking it for a test drive Continue reading gganimation for the nation
Automatic (slides) for the people
Creating and saving multiple plots to Powerpoint Continue reading Automatic (slides) for the people
Where am I?
Notes on the here package Continue reading Where am I?

Mid Table Mediocrity
Visualising potential winners and promotion prospects in the Scottish Championship Continue reading Mid Table Mediocrity

More tidy evaluation with ggplot2
Another look at tidy evaluation with a slight twist on the previous post Continue reading More tidy evaluation with ggplot2

Tidily evaluated ggplot2
Test driving tidy evaluation in the new release of ggplot2 Continue reading Tidily evaluated ggplot2

Even Simpler SQL
A follow up post, with improved SQL and dplyr code Continue reading Even Simpler SQL

simpler SQL with dplyr
comparing dplyr with SQL nested queries - and there is only one winner Continue reading simpler SQL with dplyr

AphA Scotland - it's a thing now
Reflections on AphA Scotland launch event Continue reading AphA Scotland - it's a thing now

Simply Mapping
Using the simple features package (sf), dplyr and ggplot2 to map Scottish Index of Multiple Deprivation (SIMD) 2016 data Continue reading Simply Mapping

The hourly heatmap with ggplot2
How I made the 24/7 heatmap from my previous post with ggplot2, dplyr and lubridate Continue reading The hourly heatmap with ggplot2

Daily metric tracking with ggplot2
Create calendar style plots for various measures and metrics over the same period with ggplot2 Continue reading Daily metric tracking with ggplot2

F is for Forecast
First steps with understanding time series, the forecast package and prediction using R Continue reading F is for Forecast

ggExtra is Extra useful
Amending scales on ggplots with easy to remember syntax Continue reading ggExtra is Extra useful