简体   繁体   中英

R: How to get rid of default data and values stored in global environment

Every time I open my laptop R, the same data and values (data tables and variables I used in the past) keep on appearing, and it's annoying to rm() them every time I open a new file to work on something else. My question is: 1) Is there a way to reset or set default data and variables in global environment? For example, if I'm working on file1 , I want to use data table data1 , data2 , and data3 and variable v1 , v2 , and v3 . It'd be nice if I can store these set of data and variables for file1 specifically and simply call them instead of loading the data and running the codes every time I open the file.

Thank you!

In RStudio, press the button with the broom icon to remove all objects from the environment. Include hidden objects. Then, quit RStudio and make sure to save the workspace image to ~/.Rdata. This should fix your problem. When you open RStudio again, the Global Environment should be empty.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM