I am using Windows. When trying to plot a graph on png device, it fails with the error.
My code:
png("C:\\plot1.png", width = 480, height = 480, units = "px", bg = "white")par(mar= c(4, 4, 2, 1))hist(pwrcon$Global_active_power,col = "red", main = "Global Active Power", xlab = "Global Active Power (kilowatts)")dev.off()
Error:
Error in png("C:\\plot1.png", width = 480, height = 480, units = "px", : unable to start png() deviceIn addition: Warning messages:1: In png("C:\\plot1.png", width = 480, height = 480, units = "px", : unable to open file 'C:\plot1.png' for writing2: In png("C:\\plot1.png", width = 480, height = 480, units = "px", : opening device failed
Can anyone help me in getting this resolved?
Thanks in advance