dev.off()在R语言中显示cannot shut down device 1 (the null device),不知道是哪里出现了问题,请问有什么解决办法吗?

dev.off()在R语言中显示cannot shut down device 1 (the null device),
相关代码:

dev.off()
getwd()
报错:
Error in dev.off() : cannot shut down device 1 (the null device)
谢谢!