Petto
Petto

Reputation: 11

Receiving Error in R when running dev.off()

I repeatedly receive this Error.

Error in http://dev.off() : cannot shut down device 1 (the null device)

What is the problem?

Upvotes: 1

Views: 1792

Answers (2)

Antoni
Antoni

Reputation: 342

I recommend using the following statement:if(dev.cur() > 1) dev.off()

Upvotes: 1

Lacococha
Lacococha

Reputation: 142

You should have a previous plot, otherwise you will receive an error

plot(1)

dev.off()
null device 
          1
#Once the graphics device is shutted down...
dev.off()
Error in dev.off() : cannot shut down device 1 (the null device)

Upvotes: 0

Related Questions