Articles by R on Alan Yeung

Summarising Dates with Missing Values

October 1, 2023 | R on Alan Yeung

This blog post is just a note that when you try to do a grouped summary of a date variable but some groups have all missing values, it will return Inf. This means that the summary will not show up as an NA and this can cause issues in analysis ... [Read more...]

Rafa 21 Grand Slams and gganimate

February 12, 2022 | R on Alan Yeung

I’ve been a Nadal fan for a long time – right back to the days of the pirate-pants so yeah, really a long time. In all this time, Rafa has never been ahead in the grand slam race vs his biggest rivals… but that finally changed after the 2022 Austra... [Read more...]

Filtering with string statements in dplyr

May 12, 2020 | R on Alan Yeung

A question came up recently at work about how to use a filter statement entered as a complete string variable inside dplyr’s filter() function – for example dplyr::filter(my_data, "var1 == 'a'"). There does not seem to be much out there on this and I was not sure how ... [Read more...]

Updating packages on a drat repo

May 2, 2020 | R on Alan Yeung

This is just a small note (mainly for myself but hopefully may be of some use to a few others!) to remind of how to update a package on a drat repo. Create the source file for the package you want to host on the drat repo using devtools::build(). ... [Read more...]

Updating packages on a drat repo

May 2, 2020 | R on Alan Yeung

This is just a small note (mainly for myself but hopefully may be of some use to a few others!) to remind of how to update a package on a drat repo. Create the source file for the package you want to host on the drat repo using devtools::build(). ... [Read more...]

Scotland’s Most Popular Babynames

January 24, 2020 | R on Alan Yeung

Downloading the data Shiny App I recently saw this great post on Nathan Yau’s FlowingData website which guesses a person’s name based on what the name starts with. It also needs you to select a gender and a decade for when you were born before it can guess. ... [Read more...]

Scotland’s Most Popular Babynames

January 24, 2020 | R on Alan Yeung

Downloading the data Shiny App I recently saw this great post on Nathan Yau’s FlowingData website which guesses a person’s name based on what the name starts with. It also needs you to select a gender and a decade for when you were born before it can guess. ... [Read more...]

Trying the ckanr Package

November 11, 2019 | R on Alan Yeung

How resources are grouped in CKAN Initialising ckanr and exploring groups of resources Connect to CKAN with dplyr and download from one resource Downloading all resources from a dataset In previous blog posts (Hacking dbplyr for CKAN, Getting Open Data into R from CKAN) I have been exploring how to ...
[Read more...]

Trying the ckanr Package

November 11, 2019 | R on Alan Yeung

How resources are grouped in CKAN Initialising ckanr and exploring groups of resources Connect to CKAN with dplyr and download from one resource Downloading all resources from a dataset In previous blog posts (Hacking dbplyr for CKAN, Getting Open Data into R from CKAN) I have been exploring how to ...
[Read more...]

objectremover RStudio Addin

August 11, 2019 | R on Alan Yeung

A Learning Exercise Workflow I created my first ever R package and got it released onto CRAN in March 2019. It’s taken me a while to get round to actually writing about this which tells me that despite many years of trying to overcome procrast... [Read more...]

objectremover RStudio Addin

August 11, 2019 | R on Alan Yeung

A Learning Exercise Workflow I created my first ever R package and got it released onto CRAN in March 2019. It’s taken me a while to get round to actually writing about this which tells me that despite many years of trying to overcome procrast... [Read more...]

Hacking dbplyr for CKAN

July 6, 2019 | R on Alan Yeung

Aim Create a dummy database Test dbplyr’s SQL translation Modify dbplyr’s SQL translation Testing the dbplyr hack Concluding notes At the end of my first post on CKAN discussing how to use the CKAN API to extract data from the NHS open data platform directly into R, I ... [Read more...]

Hacking dbplyr for CKAN

July 6, 2019 | R on Alan Yeung

Aim Create a dummy database Test dbplyr’s SQL translation Modify dbplyr’s SQL translation Testing the dbplyr hack Concluding notes At the end of my first post on CKAN discussing how to use the CKAN API to extract data from the NHS open data platform directly into R, I ... [Read more...]

Getting Open Data into R from CKAN

June 4, 2019 | R on Alan Yeung

Preamble Open Data in Scotland Querying CKAN Querying with Custom JSON Querying with SQL Conclusions and Further Ideas Preamble I’ve got lots of rough pieces of R code written as I’ve been exploring/testing various things in the past. A lot of this is currently stored in a ... [Read more...]

Getting Open Data into R from CKAN

June 4, 2019 | R on Alan Yeung

Preamble Open Data in Scotland Querying CKAN Querying with Custom JSON Querying with SQL Conclusions and Further Ideas Preamble I’ve got lots of rough pieces of R code written as I’ve been exploring/testing various things in the past. A lot of this is currently stored in a ... [Read more...]

Glasgow R User Group

May 20, 2019 | R on Alan Yeung

I am very excited to hear that there are attempts to create a brand new R user group in Glasgow! I had just talked in Post Number One about my guilt at not having been able to attend EdinbR as often as I wished but it should be much easier ...
[Read more...]

Glasgow R User Group

May 20, 2019 | R on Alan Yeung

I am very excited to hear that there are attempts to create a brand new R user group in Glasgow! I had just talked in Post Number One about my guilt at not having been able to attend EdinbR as often as I wished but it should be much easier ...
[Read more...]

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)