0

I am new to R program.

I have a lot of files in the environment, x1,x2,x3.....x1279.

How do I remove all the x files?

I used to use GrADs, where I can simply remove the files using asterik *

Is there a similar function in R? Do I have to use a while loop?

eg.

n<-1
while(n<1279){

remove(x*,n)

n<-n+1

}

Thanks!

Confusion Matrix
  • 116
  • 2
  • 14
MT32
  • 677
  • 1
  • 11
  • 24

1 Answers1

0

You can remove everything from the environment using rm(list=ls()). See ?rm and ?ls.

Confusion Matrix
  • 116
  • 2
  • 14
  • Hi, I dont wanna remove all. only the x files. there are also other files in the environment as well. – MT32 May 17 '18 at 04:29