Day: December 17, 2020

Easy error handling in R with purrr’s possibly

It’s frustrating to see your code choke part of the way through while trying to apply a function in R. You may know that something in one of those objects caused a problem, but how do you track down the offender?

The purrr package’s possibly() function is one easy way.

In this example, I’ll demo code that imports multiple CSV files. Most files’ value columns import as characters, but one of these comes in as numbers. Running a function that expects characters as input will cause an error.

For setup, the code below loads several libraries I need and then

Read More

How to handle R errors when iterating

Hi. I’m Sharon Machlis at IDG Communications, here with Episode 55 of Do More With R: Easy R error handling when iterating.

There’s little more annoying when running code over a lot of objects than having the code choke part of the way through. Something in one of those objects caused a problem, and you need to track down the offender.

Purrr’s possibly() function is an easy way to do that. Let’s take a look.

I run into this a lot when I’m trying to import CSV or Excel files that I think all have the same structure. But actually,

Read More

Google’s latest Chromecast is finally getting Apple TV

If you’re a Google TV user who’s been dying to watch some Apple TV+ content, I have some good news: an Apple TV app is finally coming to the latest Chromecast in “early 2021.”

As noted by Google in its announcement post, that will make the Chromecast with Google TV “one of the only streaming devices will all the major video subscriptions.” Apple TV+ was pretty much the only one left.

Google specifically mentions the latest Chromecast in its blog post, not Android TV devices in general, so it’s not clear if the app will make its way over to

Read More