MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1o66q3j/neverforget/njfoctt/?context=3
r/ProgrammerHumor • u/leeleewonchu • Oct 14 '25
615 comments sorted by
View all comments
Show parent comment
-1
that's why I like R.
df[df$city == "NYC",]
df[df$city == "NYC", "city"] <- "DC"
OR
df$city[df$city == "NYC"] <- "DC"
df <- df[df$city != "NYC", ]
View all comments
Show parent comment
-1
u/Kitchen-Quality-3317 Oct 14 '25
that's why I like R.
Select:
df[df$city == "NYC",]Update:
df[df$city == "NYC", "city"] <- "DC"OR
df$city[df$city == "NYC"] <- "DC"Delete:
df <- df[df$city != "NYC", ]