Methow Valley Air Quality

Mazama Science has released a new set of tutorials demonstrating the use of air quality R packages to investigate data from regulatory monitors and low-cost sensors. This post is just a short summary of what the tutorials cover. We invite anyone interested in wildfire smoke and air quality to run through the tutorials and provide feedback.

Continue reading

MazamaSpatialUtils R package

Version 0.7 of the MazamaSpatialUtils is now available on CRAN and includes an expanded suite of spatial datasets with even greater cleanup and harmonization than in previous versions. If your work involves environmental monitoring of any kind, this package may be of use. Here is the description:

A suite of conversion functions to create internally standardized spatial polygons dataframes. Utility functions use these data sets to return values such as country, state, timezone, watershed, etc. associated with a set of longitude/latitude pairs. (They also make cool maps.)

In this post we discuss the reasons for creating this package and describe its main features.

Continue reading

Data producers vs. data consumers

In the marketplace, the needs of producers and consumers are often at odds:  producers want higher prices, consumers lower ones; producers want easy assembly, consumers easy dis-assembly; producers want flexibility and rapid prototyping, consumers reliability and long-term support.

The same competing needs exist in the world of scientific data management where producers of data and consumers of data often operate in very different worlds with very different sets of tools.

Continue reading

When is a number not a number?

Have you ever asked yourself whether your telephone number is really a number?  It’s got numbers in it but does it measure anything?

How about your credit card number?  PO Box?  Social Security Number?  Zip code? What would happen if you subtracted one of these from another?

As it turns out, many of the “numbers” we deal with every day are actually identifiers and not a measure of something.  Sadly, too many data managers do not distinguish between the two even though making this distinction is quite simple.

Continue reading
| Tagged

Standard Latitudes and Longitudes

What?  Where?  When?

These are key questions that every scientist or other collector of environmental data must answer.

  • What is the value of the thing we are measuring?
  • Where are we taking the measurement?
  • When are we taking the measurement?

In a previous post we discussed how to standardize “when”.  But what about “where”?

Continue reading

Easier Error Handling in R with try()

In a previous post, we looked at error handling in R with the tryCatch() function and how this could be used to write Java style try-catch-finally blocks. This time we’ll look at what can be done with the try() function and how we can easily process warning and error messages to take appropriate action when something goes wrong.

Continue reading
| Tagged

Basic Error Handing in R with tryCatch()

The R language definition section on Exception Handling describes a very few basics about exceptions in R but is of little use to anyone trying to write robust code that can recover gracefully in the face of errors. In fact, if you do a little searching you will find that quite a few people have read through the ?tryCatch documentation but come away just as confused as when they started. In this post we’ll try to clarify a few things and describe how R’s error handling functions can be used to write code that functions similarly to Java’s try-catch-finally construct.

Continue reading
| Tagged