stevensanderson, 16 days ago to programming 🔎 Selecting Columns Containing a Specific String in R: A Quick Guide 🚀 Hey R users! Need to select columns by a specific string? Here's how in base R, stringr, stringi, dplyr, and with a bonus from data.table. 🆒 R ✅ grepl 📦 stringr 📦 stringi 📦 dplyr Bonus: 📦 data.table library(data.table) df_price <- df[, names(df) %like% "price"] Happy coding! 🚀 Post: https://www.spsanderson.com/steveondata/posts/2024-05-15/ #R #RProgramming #Programming #RStats #Coding #RegularExpressions #RegEx #stringr #stringi #dplyr #datatable #baseR image/png image/png image/png
🔎 Selecting Columns Containing a Specific String in R: A Quick Guide 🚀
Hey R users! Need to select columns by a specific string? Here's how in base R, stringr, stringi, dplyr, and with a bonus from data.table.
🆒 R ✅ grepl 📦 stringr 📦 stringi 📦 dplyr
Bonus: 📦 data.table library(data.table) df_price <- df[, names(df) %like% "price"]
Happy coding! 🚀
Post: https://www.spsanderson.com/steveondata/posts/2024-05-15/
#R #RProgramming #Programming #RStats #Coding #RegularExpressions #RegEx #stringr #stringi #dplyr #datatable #baseR
image/png image/png image/png