How to undo effect of a command in RStudio?




I accidentally made changes to a data frame of 1000+ rows. Now how do I undo that or should I have to start again :frowning: ?

The command which I want to undo is

dataframe1$col [dataframe1$col %in% c(“value1”,“value2”)] <- “value”

PS : I also tried using Undo option from Edit menu but it didn’t work…



You need to start again :frowning:


Thanks for replying @aayushmnit

Can you tell me the use of undo option from Edit menu?




If you make a change to code which you want to undo that’s what that option is for, Example: You accidentally deleted some line in the code which you want back you can use the undo functionality.


A sample advise : always save your workspace after a long modification on your dataset