Techno Blender
Digitally Yours.
Browsing Tag

Spanton

Five Things I Learned From My First R Programming Event | by Rory Spanton | May, 2023

Lessons about R, data science, and engaging an audience from SatRDays LondonPhoto by Teemu Paananen on UnsplashLast month, I did something I’d never done before. I attended an in-person event all about data science — specifically, doing data science in the R programming language.Conferences aren’t new to me. As a researcher in psychology, I’ve attended and presented at many conferences in my field. But, despite being a long-time R enthusiast, I hadn’t ever got the chance to go to a non-academic conference about data…

Tidyverse vs. Base-R: How To Choose The Best Framework For You | by Rory Spanton | Feb, 2023

The pros and cons of the most popular approaches to R programmingPhoto by Chris Wynn from PexelsProgrammers are passionate people. They’ll enter enthusiastic debates (read, heated arguments) about their favourite languages and frameworks, defending their preferred approaches from critics. Among R programmers, one of the biggest sources of debate is the choice between two frameworks; Base-R, and tidyverse.Base-R refers to all the functionality that comes built into the R programming language. The tidyverse is a collection…

Going Beyond group_by: How to Group Data in R | by Rory Spanton | Feb, 2023

Go from beginner to advanced with these grouping workflowsPhoto by Camille San Vicente on UnsplashGrouping data allows you to perform operations on subsets of a dataset, rather than the entire dataset. Working with grouped data is a crucial aspect of data analysis, and has near-limitless uses in data science.There are many ways to create and manipulate groups with R. In this article, I’ll explain grouping workflows from the dplyr package, from the fundamentals to more advanced functions.By the end, you should have all the…

How to Use Map Functions for Data Science in R | by Rory Spanton | Feb, 2023

Learn powerful functional programming tools from the tidyversePhoto by Z on UnsplashAll data scientists need to repeat code. Whether you’re fitting a model to multiple datasets or changing many values at once, running the same code many times over is essential.There are many ways to repeat code. But while most programmers use loops, there are more succinct, readable, and efficient alternatives. Enter, the map family of functions from the purrr package.In this article, I’ll explain what mapping means, and how to use the…

How to Reverse Code an Interval Scale in R | by Rory Spanton | Nov, 2022

An easy way to clean questionnaire and measurement dataPhoto by Alex Green from PexelsIf you’re using R for data analysis, chances are you might run into a situation where you’re working with interval data. Often, it’s useful to be able to reverse data on an interval scale. Here’s how to do it, with step-by-step examples. If you want all the code featured in this article in one script, check out the GitHub gist at the end.Imagine you’re a psychologist who has collected data about people’s experiences of anxiety. You gave…

Make Your R Code 10x Faster: Vectorization Explained in 3 Minutes | by Rory Spanton | Aug, 2022

Your code after vectorization. Photo by Nate Johnston on UnsplashR doesn’t have a reputation for being a fast programming language. Compared to speedier counterparts like C++, it’s sluggish at best. That said, you can make your R code run a lot faster if you understand a key concept that underlies the entire language.This concept is called vectorization, and you can learn about it in three minutes.In R, vectors are a basic type of variable that contain a value, or set of values. They’re very common; if you’ve ever…