Publications by John MacKintosh
demystifying the coalesce function
What does coalesce mean? In the English language, it is generally used to convey a coming together, or creating one whole body, mass or system. How does that help us when working with data? We spend a lot of time cleaning our data, surely the last thing we want to do is lump it all together? In dplyr, coalesce takes after SQL’s coalesce. Any i...
3624 sym R (1935 sym/19 pcs)
PreppinData – accepting the challenge with R and PowerBI
I had the good fortune of stumbling across a tweet by the organisers of PreppinData This is a bit like Tidy Tuesday, except it’s focussed more on data preparation than data visualisation. Ostensibly, it’s for people to get to grips with Tableau’s data preparation tool, but the organisers are open to other solutions using other tools. Preppi...
5135 sym R (959 sym/6 pcs) 4 img
PreppinData – accepting the challenge with R and PowerBI
I had the good fortune of stumbling across a tweet by the organisers of PreppinData This is a bit like Tidy Tuesday, except it’s focussed more on data preparation than data visualisation. Ostensibly, it’s for people to get to grips with Tableau’s data preparation tool, but the organisers are open to other solutions using other tools. Preppi...
5135 sym R (959 sym/6 pcs) 4 img
Scheduled Refresh – a surprisingly simple fix
At work we recently got our first PowerBI report up and running. However, the Scheduled Refresh was not working, so we were doing manual updates and republishing the report daily. I checked the permissions on the account were correct, and the credentials in the report were also fine. However, the connection string specified on the server was in l...
1409 sym
Scheduled Refresh – a surprisingly simple fix
At work we recently got our first PowerBI report up and running. However, the Scheduled Refresh was not working, so we were doing manual updates and republishing the report daily. I checked the permissions on the account were correct, and the credentials in the report were also fine. However, the connection string specified on the server was in l...
1409 sym
Some data.table tips
I’ve been using data.table quite a lot in my spare time, and I want to make a few notes of some things I’ve learned along the way. I would say I’m no longer a beginner, not yet an expert, but getting there.. As noted in a previous post, I’ve been doing the PreppinData challenges, or at least I was – things have fallen a bit by the waysi...
3878 sym R (3145 sym/8 pcs)
Introducing popthemes
Back once again with the block rocking themes! Yes, having produced a set of R colour palettes based on Metallica album covers, and then another set of palettes based (loosely) on classic rock album covers, I’ve decided to complete the set with{popthemes} One problem with {rockthemes} is that I got carried away, and I have way more palettes tha...
4634 sym R (226 sym/11 pcs) 24 img
Cutting down code in dplyr and data.table
After a very long , R free hiatus (I don’t recommend it) I’m back on the R train, destination unknown. I had a bit of spare time last night, and remembered I had not done a PreppinData challenge for a while. In fact, the last one I did was week 8, and they are now on week 31 – the exact details of the challenge can been seen below. Preppin...
5260 sym R (2919 sym/8 pcs)
Well Well Well my Excel
Importing multiple excel files (not sheets, but files) and flattening into one data frame / tibble / data.table should be straightforward – shouldn’t it? How many ways can there be? What are the pros and cons of each? I’ve made three copies of an excel file from a PreppinData challenge. For this, I just want to import the first sheet from e...
2830 sym R (8042 sym/12 pcs)
Calculating hotel occupancy with R
I saw a question on reddit today which can be answered using {patientcounter} The asker wants to know how to work out how many folk are in a hotel, at any given time, based on check in and check out dates. Here’s the setup: check_in_date <- c('2010-01-01', '2010-01-02' ,'2010-01-01', '2010-01-08', '2010-01-08', '2010-01-15',...
1036 sym R (2205 sym/3 pcs)