I want to remove some of the variables, NOT all as remove()
and rm
would do.
In Matlab I'd wright:
clearvars -except Environnement Species *_species Latitude Longitude
Asked
Active
Viewed 378 times
-3
-
So you want to delete all variables except for specified ones? – Jan Sila Dec 15 '16 at 09:13
-
@JanSila Excactly! Do you have something in mind? – Labrini Dec 15 '16 at 09:15
1 Answers
0
This is the best I can do. This creates a,b,c
and deletes everything the the Global Env
except for b
.
a<-1
b<-2
c<-1:5
rm(list = ls()[!ls() %in% c("b")])

Jan Sila
- 1,554
- 3
- 17
- 36