You’re staring at your assignment, hands hovering over the keyboard, and all you can think is: “What on earth does ‘pass by value’ mean in R? Why do my variables keep changing when I copy them? And what’s this about pointers—doesn’t R handle memory for me?” If that’s you, trust me, you’re not alone. I’ve been there, stuck for hours, convinced I understood variables and memory... until my code started behaving in ways I couldn’t predict. This is the story of how a single R assignment finally helped me get it—and how you can too. Why R’s Memory Model Feels So Weird If you’ve programmed in Python or Java before, you might expect R to behave the same way when you assign variables. Turns out, R does things a little differently, and that’s where most people get tripped up. Here’s the core confusion: In some languages, assigning one variable to another creates a reference (a kind of pointer). In R, it looks like you’re copying values, but under the hood, R is using something called “copy-on-modify.” The result?…