Publications by Random R Ramblings

Posts

14.09.2019

Related To leave a comment for the author, please follow the link and comment on their blog: Random R Ramblings. R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job. Want to share your content on R-bloggers? click here...

400 sym

Selecting the max value from each group, a case study: dplyr and sparklyr

22.09.2019

Introduction In my last post we looked at how to slice a data.table by group to obtain the rows for which a particular column in that group is at its maximum value using the excellent data.table package. In this post, we will be taking a look at how to perform this task using dplyr and sparklyr. dplyr First, let’s take a look at our data. libr...

4395 sym R (3705 sym/7 pcs)

Get and Set List Elements with magrittr

01.02.2020

Introduction Did you know that the magrittr pipe, %>%, can be used for more than just data.frames and tibbles? In this blog post, we look at how we can create get and set functions for list elements. Getting List Elements First, let’s create a simple list. z1 <- list(a = pi, b = 2.718, c = 0.57721) z1 # $a # [1] 3.141593 # # $b # [1] 2.718 # ...

2545 sym R (1017 sym/12 pcs)

Primitive Functions List

01.02.2020

Ever wondered which R functions are actually passed to internal C code? Well, wonder no more as it turns out there is an unexported named list within the methods package providing instructions for turning builtin and special functions into generic functions. Wrapping this list with names() gives us the list of all R functions which wrap calls to ...

763 sym R (5231 sym/1 pcs)

Building a base dplyr with primitives

15.02.2020

Introduction In one of my latest posts, I discussed the idea of turning base R’s get and set operators ([, [[, [<-, [[<-) into human readable and pipeable functions. It was kindly pointed out in the comments that the get() and set() functions I defined in that blog post are actually exported in the magrittr package as magrittr::extract2() ([[) ...

6576 sym R (9576 sym/17 pcs)

Including Function Factories in an R Package: Using Collate

25.02.2020

Introduction This week I was working on a package which included a function factory. A function factory is a function which returns a function. The problem I faced was that when I was running R CMD check on my package, the check informed me my package had several issues which on first glance were confusing and seemingly shouldn’t have been repo...

4149 sym R (1366 sym/4 pcs)

Building A base dplyr With Primitives: Grouped Operations, Pipes and More!

27.02.2020

Introduction In my last post we looked at how we can recreate base equivalents of the dplyr functions select(), filter(), mutate() and arrange(), amongst others. I wrote these functions and presented them in a new package called poorman. In this post I will be discussing new functionality that I have since added to poorman including grouped opera...

4766 sym R (13359 sym/7 pcs)

poorman: Replicating dplyr’s Join and Filter Join Functions with base R

08.03.2020

Introduction In my last post I discussed performing split-apply-combine operations on R data.frames and how this functionality was used within poorman – a base R replica of dplyr. In this post I’d like to talk about replicating dplyr’s join and filter join functionality, again using nothing but base. Joins First of all, let’s set up some...

5743 sym R (3497 sym/19 pcs)

poorman: First Release of a base R dplyr Clone

01.04.2020

Introduction The first official release of poorman (v 0.1.9) is now on CRAN! You can now install poorman directly from CRAN with the following code: install.packages("poorman") In this blog post I want to address some common questions that I have received since I started writing the package. What is poorman? poorman is a package that unapologeti...

5439 sym R (245 sym/4 pcs) 2 img

poorman: The Selectificator 2000!

13.04.2020

Introduction Welcome to my series of blog posts about my data manipulation package, {poorman}. For those of you that don’t know, {poorman} is aiming to be a replication of {dplyr} but using only {base} R, and therefore be completely dependency free. What’s nice about this series is that if you’re not into {poorman} and would prefer just to ...

8080 sym R (1679 sym/16 pcs)