1:59

In this instructional segment, Richard Cotton explains how the R class() function can be used not only to query an object's class but also to override it. He creates a numeric vector of random exponential numbers, assigns it a new class attribute called "random numbers," and shows that the object's displayed class changes while its underlying type remains numeric. Cotton highlights that typeof cannot be overridden, making the object retain an implicit numeric class. He demonstrates that standard functions such as is.numeric, length, and mean continue to operate correctly despite the altered class attribute, confirming that existing functionality is preserved. The segment concludes with a preview that Chapter 2 will explore leveraging custom classes, emphasizing that class overriding can be done without reinventing core R behavior.

Chapters

More from Richie

youtube.com

#359 My Best Friend is AI with Valerie Tiberius, Professor of Philosophy at University of Minnesota

5mo ago
youtube.com

17.8% of the World Now Uses AI — And the Gap Is Widening | The Median #5

5mo ago
youtube.com

Create GPTs to Automate Go-To-Market Research

5mo ago
youtube.com

What Happened to Self-Driving Cars? #AI

5mo ago
youtube.com

Never Use AI For This #warning #AI #flights

5mo ago
youtube.com

Use AI Agents to Analyze Power Grid Optimization

5mo ago
youtube.com

This is how modern AI actually solves problems #AITrends #AI

5mo ago
youtube.com

How AI Agents Will Work While You Sleep | Ruslan Salakhutdinov, Professor at Carnegie Mellon

5mo ago
youtube.com

#358 How AI Agents Will Work While You Sleep | Ruslan Salakhutdinov, Professor at Carnegie Mellon

5mo ago
youtube.com

Build an AI‑driven Dashboard

5mo ago
youtube.com

What’s Broken in Labor Markets Today #datascience

5mo ago
See all content