Reset the graphical parameters back to default values without use of dev.off()

See ?par. The idea is that you save them as they are when you found them, and then restore:

old.par <- par(mar = c(0, 0, 0, 0))
## do plotting stuff with new settings

Now restore as they were before we changed mar:

par(old.par)

In RStudio, You can just navigate to 'Plots' and select 'Remove plots'