Skip to content

Instantly share code, notes, and snippets.

@cavedave
Created June 18, 2022 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cavedave/53fa530945708f4533ad110fc59fd833 to your computer and use it in GitHub Desktop.
Save cavedave/53fa530945708f4533ad110fc59fd833 to your computer and use it in GitHub Desktop.
Looking at the actual data discussed in this 2013 articlel claiming no increase in world temperature 1998-2013 https://www.dailymail.co.uk/news/article-2425775/Climate-scientists-told-cover-fact-Earths-temperature-risen-15-years.html
#choose or open the file directly
f <- file.choose()
library(dplyr)
trust <- read.csv(f)
#trust <- read.csv("HadCRUT.csv",header=TRUE)
head(trust)
#names(trust)[names(trust) == 'Anomaly..deg.C.'] <- "Anomaly..deg.C"
#if graphing all not filtering by year
vac<-trust
vac<-trust %>%
filter((Time >1997 & Time <2014))
head(vac)
#theme
theme_web_bw <- function() {
theme_bw() + # note ggplot2 theme is used as a basis
theme(plot.title = element_text(size = 16, face = "bold",
hjust = .5,
margin = margin(t = 5, b = 25)),
plot.caption = element_text(size = 12, hjust = 0,
margin = margin(t = 15)),
panel.grid.major = element_line(colour = "grey88"),
panel.grid.minor = element_blank(),
legend.title = element_text(size = 14, face = "bold"),
legend.text = element_text(size = 14),
strip.text = element_text(size = 14, face = "bold"),
axis.text = element_text(size = 14),
axis.title.x = element_text(margin = margin(t = 10), size = 15),
axis.title.y = element_text(margin = margin(r = 10), size = 15))
}
library(ggplot2)
# Basic scatter plot
ggplot(vac, aes(x=Time, y=Anomaly..deg.C.)) + geom_point()+
geom_smooth(method=lm) +
ggtitle("World Temperature over time", subtitle="Hadcrut date. Anomoly above 1950-1980 average")+theme_web_bw()
ggsave("MailAll.png")
@cavedave
Copy link
Author

cavedave commented Jun 18, 2022

Mail98
MailAll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment