Learn R Programming

A dedicated Slack channel has been created for announcements, support and to help build a community of practice around this open source package. You may request an invitation to join from jonathan.s.callahan@gmail.com.

MazamaCoreUtils

A suite of utility functions providing functionality commonly needed for 
production level projects such as logging, error handling, cache management and 
date-time parsing. Functions for date-time parsing and formatting require that 
timezones be specified explicitly, avoiding a common source of error when 
working with environmental time series.

Background

The MazamaCoreUtils package was created by Mazama Science to regularize work building R packages, data processing pipelines and web services focused on environmental monitoring data.

The main goal of this package is to create an internally standardized set of functions that for use in various systems that are being run operationally. Areas of functionality supported by this package include:

  • python style logging
  • simple error messaging
  • cache management
  • API key handling
  • date-time parsing and formatting
  • lat/lon validation and uniqueID creation
  • source code linting

Installation

Install from CRAN with:

install.packages('MazamaCoreUtils')

Install the latest version from GitHub with:

devtools::install_github('mazamascience/MazamaCoreUtils')


Development of this R package has been supported with funding from the following institutions:

Questions regarding further development of the package should be directed to jonathan.s.callahan@gmail.com.

Copy Link

Version

Install

install.packages('MazamaCoreUtils')

Monthly Downloads

800

Version

0.6.2

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Jonathan Callahan

Last Published

May 6th, 2026

Functions in MazamaCoreUtils (0.6.2)

%>%

Pipe operator
parseDatetime

Parse datetimes
initializeLogging

Initialize standard log files
createLocationID

Create one or more unique location IDs
createLocationMask

Create a mask of valid locations
stopIfNull

Stop if an object is NULL
showAPIKeys

Show API keys
timeRange

Create a POSIXct time range
timeStamp

Create character timestamps
tidyeval-data

Data pronoun for tidy evaluation
logger.warn

Python-style logging statements
stopOnError

Stop on try-error
logger.trace

Python-style logging statements
logger.fatal

Python-style logging statements
logger.error

Python-style logging statements
validateLonsLats

Validate longitude and latitude vectors
logger.isInitialized

Check whether logging has been initialized
loadDataFile

Load R data from a URL or local file
lintFunctionArgs

Lint function calls for required named arguments
setAPIKey

Set API key
setIfNull

Set a variable to a default value if it is NULL
html_getTables

Extract tables from an HTML page
APIKeys

API keys for data services
html_getLinks

Extract links from an HTML page
dateRange

Create a POSIXct date range
dateSequence

Create a POSIXct date sequence
logger.setLevel

Set console log level
logger.debug

Python-style logging statements
logger.setup

Set up Python-style logging
logger.info

Python-style logging statements
manageCache

Manage cache size
MazamaCoreUtils-package

MazamaCoreUtils
getAPIKey

Get API key
logLevels

Log levels
packageCheck

Run package checks
timezoneLintRules

Timezone linting rules
validateLonLat

Validate longitude and latitude values