How to remove variable from work space in R

r

#1

I am calculating the volume of cylinder and in between I have defined the value of small r and capital R but after calculation of volume I want to remove from workspace which I am not able to perform it
r=2
R=6
volume=2pipirr*R
volume
[1] 473.741
ls()
[1] “r” “R” “volume”


#2

rm or remove could be used to remove the objects from the workspace

  1. To remove one by one: rm® and rm®
  2. To remove both at once : rm(r,R)
    remove can be used in place of rm as well

Hope this helps