Sunsettommy
Diamond Member
- Mar 19, 2018
- 15,167
- 12,733
- 2,400
Sunsettommy fled. He had everything he was requesting, just was unwilling and/or lacked the ability to put in any effort and then insults someone who actually did. Formula is to look at UAH chart and then importantly question it, perform quick ferocious google to turn up what appears to be the supporting data then confirm that the data does in fact match up with the chart by reproducing it.
### Download
## - R (The Comprehensive R Archive Network)
## - RStudio (RStudio)
### Inits
libs <- c('tidyverse','data.table','zoo'
new.libs <- libs[!(libs %in% installed.packages()[,'Package'])]
if(length(new.libs)) install.packages(new.libs)
lapply(libs, require, character.only = TRUE)
### Read and preprocess UAH data
df_uah <- data.table::fread('https://www.nsstc.uah.edu/data/msu/v6.0/tlt/uahncdc_lt_6.0.txt')
df_uah %>% dplyr::glimpse()
### Correct duplicate names
names <- c('year','month','global','global_land','global_sea',
'north_hemisphere','north_hemisphere_land','north_hemisphere_sea',
'south_hemisphere','south_hemisphere_land','south_hemisphere_sea',
'tropics','tropics_land','tropics_sea',
'north_ext','north_ext_land','north_ext_sea',
'south_ext','south_ext_land','south_ext_sea',
'north_pole','north_pole_land','north_pole_sea',
'south_pole','south_pole_land','south_pole_sea',
'usa48','usa49','aust')
names(df_uah) <- names
df_uah %>% dplyr::glimpse()
### Drop last row, convert measures to numeric, update month feature
df_uah <- df_uah %>%
utils::head(-1) %>%
dplyr::mutate_if(base::is.character, base::as.numeric) %>%
dplyr::mutate(month = paste(year,month,'01', sep = '-') %>% base::as.Date()) %>%
dplyr::select(month, dplyr::everything())
df_uah %>% dplyr::glimpse()
## Global Averages
df_uah %>%
ggplot2::ggplot(aes(month, global)) +
ggplot2::geom_hline(yintercept = 0, color = 'gray', size = 1) +
ggplot2::geom_point(color = 'blue') +
ggplot2::geom_line(color = 'blue') +
ggplot2::geom_smooth(method='lm', color = 'orange', fill = 'orange') +
ggplot2::geom_line(aes(y = zoo::rollmean(global, 13, na.pad = TRUE)), color = 'red', size = 1.1) +
ggplot2::xlab('') +
ggplot2::ylab('T Departure from 1991-2020 Avg. (deg. C)') +
ggplot2::ggtitle('UAH Satellite-Based Temperature of the Global Lower Atmosphere (Version 6.0)') +
ggplot2::theme_minimal()
## Sub-trends
f_substrends <- function(lookback_years) {
p <- df_uah %>%
dplyr::filter(year >= df_uah$year %>% max() - lookback_years) %>%
ggplot2::ggplot(aes(month, global)) +
ggplot2::geom_hline(yintercept = 0, color = 'gray', size = 1) +
ggplot2::geom_point(color = 'blue') +
ggplot2::geom_line(color = 'blue') +
ggplot2::geom_smooth(method='lm', color = 'orange', fill = 'orange') +
ggplot2::geom_line(aes(y = zoo::rollmean(global, 13, na.pad = TRUE)), color = 'red', size = 1.1) +
ggplot2::xlab('') +
ggplot2::ylab('T Departure from 1991-2020 Avg. (deg. C)') +
ggplot2::ggtitle('UAH Satellite-Based Temperature of the Global Lower Atmosphere (Version 6.0)') +
ggplot2::theme_minimal()
p %>% print()
}
### Call
f_substrends(9)
I didn't run away just decided to stop because of your unwillingness to provide the link I requested.