When you realize data.table is not just fast…
but also lets you:
- filter like a ninja
- group like a boss
- update in place like magic
- chain like you're riding 🚲 downhill
And all with [i, j, by].
Name a tidier feeling. I’ll wait.
#rstats #datatable
I took a photo of a USAID nutrition pack. Nothing weird… until I looked closer.
The image had hidden GPS data.
Using Python, I pulled the coordinates and put a pin on the map.
What I found was… strange.
Should foreign aid be ending up here? 👇
I found a USAID nutrition pack lying around and took a photo — just out of curiosity.
Later, I checked the image’s metadata…
It turns out that GPS coordinates were embedded in it. 👀
So I mapped it. See below for the location! 1/3
What I saw made me stop. It might provide some evidence and serious questions about how foreign aid is used — and where it ends up. 2/2
I broke down how to extract location data from any image — and revealed the exact location of this USAID pack.
🧭 Want to see where it was taken?
📍Check the map + story here:
marsja.se/how-to-extract-gps…
Should it be there? Let me know!
3/3
Working with wide data? Want to sum several columns quickly — with or without grouping? Here’s how to do it cleanly using data.table in #RStats: 👇
3️⃣ Select columns using %in%
Dynamically choose which columns to sum:
rKopieraRedigeracols_to_sum <- c("var1", "var2")
DT[, total := rowSums(.SD), .SDcols = names(DT) %in% cols_to_sum]
✅ Fast, readable, and works beautifully with large datasets.
🔗 Full #Rstats tutorial with examples:
marsja.se/how-to-sum-multipl…
Filtering large datasets in R? You might be using dplyr::filter(), but there's a faster way. 🚀 Let's compare dplyr and data.table for big data filtering. 👇 #rstats #DataScience
To find out, we ran a benchmark comparing dplyr::filter() vs data.table on a 20-million-row dataset.
We filtered rows where a > 0.5 and recorded the execution time. 🚀
Here's what happened...
Want to learn how to filter using data.table? Check out our full post here: marsja.se/how-to-filter-in-d…
#Dtascience #Rstats
How to Select Columns from data.table in #R marsja.se/how-to-select-colu… via @MarsjaSe #rstats #datascience
Mediation Analysis in Rstats: How to Run it with two Packages marsja.se/mediation-analysis… via @MarsjaSe #r


