Author Archives: gregorybooma

Nest thermostat data access using R

UPDATE 12/03/13: Since Nest Labs’ move to an official API, the code below no longer works. Still, a good example of a webservice connection… Gets “energy_latest” (10 days of usage) data from Nest Labs: Advertisements

Posted in data access, R | Tagged

Getting names of objects in an R workspace by type

To identify data frames in a workspace, and iterate over them by name, use Filter() with a few other functions: Here, objects() lists objects in the workspace, class() identifies their classes, and sapply() looks at each object in turn, returning … Continue reading

Posted in data munging, R | Tagged

Map of the United States including Alaska and Hawaii with R

Alaska and Hawaii represented in a typical state-level choropleth map — i.e. below the Southwestern border states. Turns-out it’s not that straightforward to do. After some tinkering… …the result: Seems as though the AK and HI portions of the layout … Continue reading

Posted in mapping, packages, R | Tagged , , , ,

Data collection quiz question

Q: If a large working fan is blowing on an air quality sensor, will the data be biased?

Posted in data collection | Tagged , , , ,

Converting timestamps in PostgreSQL (again)

Revisited converting timestamps to UTC from different timezones. One way to do this is a variation on the PostgreSQL documentation on date/time functions, where epoch is used as a common unit: Gets the job done, but the following is cleaner: … Continue reading

Posted in PostgreSQL | Tagged , ,


Pic of a Bottlenose dolphin (Tursiops truncatus) breaching during cooperative hunting activity; May River, Beaufort County, South Carolina. Amazing.

Posted in coastal ecology, marine biology, marine ecology | Tagged , , , , , ,

From a long to a wide R data frame, with array values

From a “long” data frame with columns containing the names of measured properties and corresponding vectors of values, attempting to make a “wide” data frame with a column for each measured property. Appears as though the cast() function of the reshape … Continue reading

Posted in data munging, R | Tagged , , , , ,