VOOZH about

URL: https://www.geeksforgeeks.org/r-language/remove-objects-from-memory-in-r-programming-rm-function/

⇱ Remove Objects from Memory in R Programming - rm() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Remove Objects from Memory in R Programming - rm() Function

Last Updated : 15 Jul, 2025
rm() function in R Language is used to delete objects from the memory. It can be used with ls() function to delete all objects. remove() function is also similar to rm() function.
Syntax: rm(x) Parameters: x: Object name
Example 1: Output:
[1] 1 2 3 4
$Number
[1] 1 2 3

$Characters
[1] "a" "b" "c"

 [, 1] [, 2] [, 3]
[1, ] 1 4 7
[2, ] 2 5 8
[3, ] 3 6 9
[1] "mat" "vec"
Example 2: Output:
character(0)
Comment
Article Tags:

Explore