Category Archives: R Example and Scripts

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

CO2 and Temperature Trends

In a previous post I discussed problems with an Excel based CO2 and temperature trend chart that used 2 Y axes. Double axis charts can be misleading because they may distort the Y axis for one of the series.

In this post I show another example of am ineffective double Y axis CO2 and temperature trend chart and present 2 alternative ways to show the same data more effectively. Links to my  R scripts and Google spreadsheet based data file are included.

Continue reading

CO2 Emission Trends

“Since 1751 approximately 329 billion [metric] tons of carbon have been released to the atmosphere from the consumption of fossil fuels and cement production. Half of these emissions have occurred since the mid 1970s. The 2006 global fossil-fuel carbon emission estimate, 8230 million metric tons of carbon, represents an all-time high and a 3.2% increase from 2005.” CDIAC

This is the 1st in a series of posts on CO2 emissions, CO2’s fate in the atmosphere and the long term climate and ocean impacts of these emissions.

In this 1st post, I use  CDIAC  CO2 emission data to prepare a trend chart and CSV file showing annual global CO2 emissions for  the period 1751-2006. The data and R script are available on-line as a Google spreadsheet and Google document  so that interested readers can easily download CSV files of the data and generate analysis and charts on their own in Excel, R or any software that will accept a CSV file.

Continue reading

Excel Chart Misrepresents CO2 – Temperature Relationship

This post reviews an Excel chart that misrepresents the CO2 – temperature anomaly relationship. The chart developer shows 2 time series on a single chart using Excel’s double Y axis capability. This is a poor charting technique which distorts the data. The developer makes things worse by only showing 15 years of data from a data set that stretches back over 100 years.

I have extended the data period to 1880 – 2008 and prepared  2 R based charts, a trend chart and a scatter plot of CO2 versus temperature anomaly.  My charts provide a more complete picture of the CO2 – temperature relationship than the original Excel chart.

Google document links to the data and R script files are provided so that readers can prepare their own  CO2 – temperature charts in R, Excel or other tools to assess the situation for themselves. Continue reading

Segmented Regression of GISS Temperature Trends

In this post I show how to use the R strucchange package to prepare a segmented regression of the annual GISS temperature anomaly data series. Continue reading

Putting Consolidated Global Temperature Data on-line

In this post I describe an R script that retrieves monthly global temperature anomaly data from 5 sources and consolidates the data into a single CSV file. I then post the consolidated file in an on-line  Google spreadsheet so that users can download the data and conduct their own global temperature trend analysis.

Continue reading

Decadal Trend Rates in Global Temperature

This post presents an R based chart of global GISS land and sea temperature anomaly data for the 1880-2009 period with both the long term trend and the individual decadal trends. Links to the source data file and the R script are provided so that readers can reproduce/ improve on this analysis. Continue reading