-1

In R ,this are object_a/object_b, i want to remove them from R environment , but rm(c('object_a','object_b')) can't work. Anyone can help? Thanks!

object_a <- c(1:3)
object_b <- c(1:6)
rm(c('object_a','object_b'))
anderwyang
  • 1,801
  • 4
  • 18

2 Answers2

1

Have you tried this?

rm(object_a, object_b)

Works also with more than 2 objects.

Marco_CH
  • 3,243
  • 8
  • 25
1

rm has a list argument:

rm(list = c('object_a','object_b'))
zx8754
  • 52,746
  • 12
  • 114
  • 209
sean ahn
  • 11
  • 2