Category Archives: R Example and Scripts

RClimate Script Introduction

Would you like to be able to generate a GISS temperature anomaly trend chart on your PC with just 1 line of R script? What about downloading the R script to your PC so that you can edit the script to fit your needs?

In this post I present my first RClimate Script so that users with just a little R experience who have R and 2 R libraries up and running on their PC  can  retrieve the latest NASA file on monthly GISS temperature anomalies, generate a trend chart and calculate the anomaly trend rate in 1-2 minutes.

Continue reading

Arctic Sea Ice Extent Trends With R

This post shows how to retrieve on-line Arctic Sea Ice Extent data from the National Snow and Ice Data Center (NSIDC), consolidate the data files, generate a csv file, summarize and plot the data and post it as a Google Docs so that interested readers can download and analyze this data series themselves.

Links to the NSIDC source data files, R script and my Google Docs csv file are provided.

Sea Ice Extent Data and Definition

The Japan Aerospace Exploration Agency (JAXA) provides daily updates to the Arctic Sea Ice Extent and maintains a downloadable csv  file of daily values from June, 2002 at this link.

JAXA and other  climate science data sites define  sea ice extent as the area of the  ocean where sea-ice concentration is 15% of more.

NSIDC maintains a series of 12 ASCII files (one for each month) that include the monthly average sea ice extent values for the period 1979 to present. I am using the NSIDC data set because it covers a longer period (31 years) than the JAXA data series.

Here’s the 1979 – 2009 trend chart of monthly Arctic sea ice extent measurement data based on NSIDC files. (Click image to enlarge)

Continue reading

Understanding the Science of CO2’s Role in Climate Change: 3 – How Green House Gases Trap Heat

This post, the 3rd (1st here, 2nd  here) in the series on Understanding the Science of CO2’s Role in Climate Change, discusses how water vapor, CO2, CH4, O3 and N2O  absorb and emit the Earth’s longwave radiation, changing the Earth’s energy balance.

I’ve made a 5 panel chart that shows spectra data for 5  greenhouse gases (GHG). Molecules of these gases in the atmosphere absorb and emit the Earth’s infrared radiation at specific frequencies, trapping some of the Earth’s  radiation, warming the planet.

I’ve included a link to my R script so that readers can access the online spectra data and generate your own GHG spectra.

Continue reading

Solar Trends: Sunspot Numbers Since 1749

This is the 1st in a series of  posts I will be doing on solar trends. In this post, I show how to retrieve online monthly sunspot data back to 1749, calculate average annual sunspot numbers (SSN),  plot the monthly and annual average SSN as well as a lowess smooth, add the Solar Cycle number to the plot and generate  a csv file that will be used in future posts. Links to the original data source, my annual SSN and cycle date Google spreadsheet files, and my R script Google document file are provided.

Continue reading

CO2: Emissions & Changes in Atmospheric Levels

In previous posts, I have shown the 1750-2008 global CO2 emission trends and the atmospheric CO2 concentrations at Mauna Loa, Hawaii. In this post, I compare annual CO2 emissions with annual changes in atmospheric CO2.  The resulting chart shows the portion of CO2 emissions that remains in the atmosphere and the portion that is soaked up by the land & ocean.  Links to the R script and source data files are provided.

Continue reading

Global Mean Sea Level Trends

In this post, I show an R script that downloads the University  of Colorado, Boulder’s 1993-2009 global mean sea level (msl) change (link) data, converts the ASCII file into a usable R data frame, calculates moving average and msl change  trend rate and develops a trend  chart that shows msl change  and trend rates and writes a csv file that I upload to Google Docs. Continue reading

Global Sea Surface Temperature Trends (1850-2009)

In this post, I show an R script that downloads the Hadley Centre’s 1850-2009 monthly sea surface temperature (HadSST2) anomaly data, converts the ASCII file into 2 usable R data frames, calculates overall and post 1980 SST anomaly trend rates and develops a 2 panel chart that shows SST anomalies and trend rates and the % global coverage for the SST series.

Continue reading