--- title: "CO2 Keeling" author: "David Elser" date: "05-03-2021" output: html_document --- ## Data preprocessing fetch the Data file and check if file already exists The data is available from the Web site of the Scripps Institute "https://scrippsco2.ucsd.edu/data/atmospheric_co2/primary_mlo_co2_record.html" Soure script available at : https://github.com/DemirhanOzelTrojan/Keeling_Predict/blob/master/main.R install.packages('forecast', dependencies = TRUE) install.packages("imputeTS") ```{r} install.packages("imputeTS") library(forecast) library(imputeTS) ``` ```{r} data_url = "https://scrippsco2.ucsd.edu/assets/data/atmospheric/stations/in_situ_co2/monthly/monthly_in_situ_co2_mlo.csv" data_file = "CO2.csv" if (!file.exists(data_file)) { download.file(data_url, data_file, method="auto") } ``` Skip the frist 5 lines of the file ```{r} data = read.csv(data_file, header=TRUE, skip=5) ``` Let's have a look at what we got: ```{r} head(data) tail(data) ``` ```{r} data$X.ppm.[data$X.ppm. == -99.99] <- NA data$X.ppm. <- na.interpolation(data$X.ppm.) head(data) tail(data) ```