Skip to content

elipousson/isstatic

Repository files navigation

isstatic

Lifecycle: experimental Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. License: CC0-1.0

The goal of isstatic is to provide a convenient set of static functions for checking object class inheritance, regex pattern matching, extracting attributes, and basic type conversion.

I’ve used and reused these functions across a number of different packages so using staticimports is also intended as a way to keep those functions standardized across projects. This package is inspired by the stringstatic package by Alex Rossell Hayes.

Installation

You can install the development version of isstatic like so:

pak::pkg_install("elipousson/isstatic")

Usage

To import functions from isstatic into your package, put a comment block starting with # @staticimports pkg:isstatic in one of your R source files.

For example, your utils.R file may have this at the top:

# @staticimports pkg:isstatic
#  is_sf is_bbox is_url

pkg:isstatic means you will import functions from the stringstatic package. You can find many other useful functions in pkg:staticimports.

Subsequent lines list the objects to import from the package. In this case, they are is_sf(), is_bbox() and is_url().

To perform the import, run:

staticimports::import()

By default, this will write the functions to an R/staticimports.R file in your project.

About

A R package for Dependency-Free Object Tests

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages