I work with lots of environmental time series data from stationary instruments. This post describes why you should avoid mixing data and metadata in a single file and instead suggests an easy-to-implement, easy-to-use, maximally compact format consisting of two .csv files linked by unique identifiers.
Continue reading “How NOT to format time series data”(re-)Learning Javascript
It’s been several years since I worked full time on a javascript project and a lot has improved in that time. This post will document my journey and will hopefully contain some best practice suggestions.
Continue reading “(re-)Learning Javascript”Significant Digits
Everyone who has taken a first year chemistry class has learned that significant digits (aka “significant figures” or “sig figs”) indicate the precision of a measurement. The basic rule is that you save all measurement digits you are certain about plus one more that you estimate. Unfortunately, computers don’t know anything about significant digits. Developers creating data systems for scientific measurements should always include a rounding step as part of any data output. Not embracing significant digits can have … uhm … “significant” consequences.
Continue reading “Significant Digits”Systematic error messages
Anyone writing code for use in data processing systems needs to have a well thought-out protocol for generating error messages and logs. When a complex pipeline breaks, good logs and recognizable error messages are key to debugging the problem. This post describes improvements to the MazamaCoreUtils package that help you create systematic error messages that can be better handled by calling functions.
Continue reading “Systematic error messages”Comparing Air Quality Sites
Air quality continues to be in the news with New York Times articles like these:
- Health Risks of Smoke and Ozone Rise in the West as Wildfire Worsen
- Even Low Levels of Soot Can Be Deadly to Older People, Research Finds
A quick review of web based air quality resources shows a range of sites featuring maps, time series plots and relevant information.
Continue reading “Comparing Air Quality Sites”Easy Rolling Means with MazamaRollUtils
Our goal in creating a new package of C++ rolling functions is to build up a suite of functions useful in environmental time series analysis. We want these functions to be available in a neutral environment with no underlying data model. The functions are as straightforward to use as is reasonably possible with a target audience of data analysts at any level of R expertise.
Continue reading “Easy Rolling Means with MazamaRollUtils”Beautiful Maps with MazamaSpatialPlots
Many of us have become addicted to The NY Times COVID maps — maps of US state or county level data colored by cases, vaccinations, per capita infections, etc. While recreating maps like these in R is possible, it is disappointingly difficult. The just released MazamaSpatialPlots R package takes a first stab at remedying this situation.
Continue reading “Beautiful Maps with MazamaSpatialPlots”Using R — Packaging a C library in 15 minutes
Yes, this post condenses 50+ hours of learning into a 15 minute tutorial. Read ’em and weep. (That is, you read while I weep.)
Continue reading “Using R — Packaging a C library in 15 minutes”Using R — Calling C code with Rcpp
In two previous posts we described how R can call C code with .C() and the more complex yet more robust option of calling C code with .Call(). Here we will describe how the Rcpp package can be used to greatly simplify your C code without forcing you to become expert in C++.
Continue reading “Using R — Calling C code with Rcpp”Using R – .Call(“hello”)
In an introductory post on R APIs to C code, Calling C Code ‘Hello World!’, we explored the .C() function with some ‘Hello World!’ baby steps. In this post we will make a leap forward by implementing the same functionality using the .Call() function.
Continue reading “Using R – .Call(“hello”)”