Remove multiple objects with rm()

后端 未结 4 984
日久生厌
日久生厌 2020-11-28 03:56

My memory is getting clogged by a bunch of intermediate files (call them temp1, temp2, etc). Is it possible to remove them from memory without doing rm(temp1),

4条回答
  •  迷失自我
    2020-11-28 03:58

    Another variation you can try is(expanding @mnel's answer) if you have many temp'x'.

    here "n" could be the number of temp variables present

    rm(list = c(paste("temp",c(1:n),sep="")))
    

提交回复
热议问题