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.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.callahan@gmail.com.

Copy Link

Version

Install

install.packages('MazamaCoreUtils')

Monthly Downloads

502

Version

0.5.3

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Jonathan Callahan

Last Published

December 3rd, 2024

Functions in MazamaCoreUtils (0.5.3)

%>%

Pipe operator
tidyeval-data

Data pronoun for tidy evaluation
timeRange

Create a POSIXct time range
logger.setup

Set up python-style logging
logger.trace

Python-style logging statements
validateLonLat

Validate longitude and latitude values
validateLonsLats

Validate longitude and latitude vectors
setAPIKey

Set APIKey
manageCache

Manage the size of a cache
logger.warn

Python-style logging statements
stopIfNull

Stop if an object is NULL
stopOnError

Error message generator
logger.isInitialized

Check for initialization of loggers
timeStamp

Character representation of a POSIXct
logger.setLevel

Set console log level
timezoneLintRules

Rules for timezone linting.
parseDatetime

Parse datetime strings
packageCheck

Run package checks
logLevels

Log levels
setIfNull

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

Show API keys
flog.appender

Manage appenders for loggers
createLocationMask

Create a mask of valid locations
dateRange

Create a POSIXct date range
dateSequence

Create a POSIXct date sequence
createLocationID

Create one or more unique locationIDs
html_getTables

Find all tables in an html page
logger.debug

Python-style logging statements
logger.fatal

Python-style logging statements
logger.error

Python-style logging statements
initializeLogging

Initialize standard log files
loadDataFile

Load R data from URL or local file
lintFunctionArgs

Lint a source file's function arguments
html_getLinks

Find all links in an html page
getAPIKey

Get API key
MazamaCoreUtils-package

MazamaCoreUtils: Utility Functions for Production R Code
flog.logger

Manage loggers
APIKeys

API keys for data services.
flog.layout

Manage logger layouts
logger.info

Python-style logging statements