HELP ? WHY DID THIS CODE GIVE NOT AUTOMATICLY A PLOT?
I'm using R-studio version Version 1.2.5019 on windows 10 home edition:
library(dplyr)
library(datasets)Pollution <- readRDS("summarySCC_PM25.rds")
types_of_combustion <- readRDS("Source_Classification_Code.rds")Pollutiongrp <-group_by(Pollution, year) #grouping the pollution by year
Pollution_all <- summarise(Pollutiongrp, emmisions_year= sum(Emissions)) ## calculates the mean per year over all regions
## plot a graph with base in R and output png
# 1. Open jpeg file
png(file = "Plot1.png")with(Pollution_all,plot(year,emmisions_year, main= "group pollution by year over all US",xlab = "Year", ylab = "total PM2.5 emission [tons]"))
## Copy my plot to a PNG file
** dev.copy(png, file = "Plot1.png")**
** print("Plot1.png")**
## Don't forget to close the PNG device!
** dev.off()**
thx for helping me