Publications by Wesley
Using R to Compare Hurricane Sandy and Hurricane Irene
Having just lived through two back to back hurricanes (Irene in 2011 and Sandy in 2012) that passed through the New York metro area I was curious how the paths of the hurricanes differed. I worked up a quick graph in R using data from Unisys. The data also includes wind speed and barometric pressure. library(maps) library(maptools) library(r...
715 sym R (1797 sym/1 pcs) 2 img
What Time Is It?
A common scenario that I run into is time and how to deal with it. I often will do a variety of summaries and analysis that need to be measured at different points in time. Whether I want to graph the data or review the results I need to be able to perform measurements relative to time and interpret the time output in human readable form. R has...
1654 sym R (1804 sym/2 pcs) 4 img
Hurricane Sandy Land Wind Speed and Kriging
NJ Hurricane Sandy Landfall Data These data come from the National Climatic Data Center (NCDC). Using the above link will download all of the data collected by the NCDC on the day of Hurricane Sandy. The data can also be obtained directly from the source at http://cdo.ncdc.noaa.gov/qclcd/QCLCD. The purpose of this post is not a discussion on...
1121 sym R (3973 sym/1 pcs) 2 img
Earthquakes Over the Past 7 Days
This is a brief example using the maps in R and to highlight a source of data. This is real-time data and it comes from the U.S. Geological Society. This shows the location of earthquakes with magnitude of at least 1.0 in the lower 48 states. library(maps) library(maptools) library(rgdal) eq = read.table(file="http://earthquake.usgs.gov/ea...
653 sym R (1321 sym/1 pcs) 2 img
Plotting Likert Scales
Graphs can provide an excellent way to emphasize a point and to quickly and efficiently show important information. Sadly, poor graphs can be a good way to waste space in an article, take up time in a presentation, and waste a lot of ink all while providing little to no information. Excel has made it possible to make all sort of graphs. However, ...
4713 sym R (3282 sym/8 pcs) 18 img
Importing Data Into R from Different Sources
I have found that I get data from many different sources. These sources range from simple .csv files to more complex relational databases, to structure XML or JSON files. I have compiled the different approaches that one can use to easily access these datasets. Local Column Delimited Files This is probably the most common and easiest approach...
4111 sym R (3185 sym/10 pcs)
Mean Value from Grouped Data
Occasionally, I will get requests from clients to calculate the mean. Most of the time it’s a simple request but from time-to-time the data was originally from grouped data. A common approach is to take the midpoint of each of the groups and just assume that all respondents within that group average out to the midpoint. The biggest problem I ...
1928 sym R (2813 sym/1 pcs) 2 img 1 tbl
Estimating Pi
Recently I’ve been working on some jackknife and bootstrapping problems. While working on those projects I figured it would be a fun distraction to take the process and estimate pi. I’m sure this problem has been tackled countless times but I have never bothered to try it using a Monte Carlo approach. Here is the code that can be used t...
1108 sym R (784 sym/1 pcs)
True Significance of a T Statistic
The example is more of a statistical exercise that shows the true significance and the density curve of simulated random normal data. The code can be changed to generate data using either a different mean and standard deviation or a different distribution altogether. This extends the idea of estimating pi by generating random normal data to...
1323 sym R (1014 sym/1 pcs) 2 img
Y2K38: Our Own Mayan Calendar…Again
It’s not quite the end of the world as we know it. We made it through December 21, 2012 unscathed. It’s not going to be the last time we will make it through such a pseudo-calamity. After all we have built our own end of the world before (e.g. Y2K). Next up January 19, 2038. We’ve unknowingly made this the date that time will stop on ...
2812 sym R (311 sym/2 pcs) 2 img