https://github.com/elipousson/isstatic
A R package for Dependency-Free Object Tests
https://github.com/elipousson/isstatic
rpackage rstats
Last synced: 30 days ago
JSON representation
A R package for Dependency-Free Object Tests
- Host: GitHub
- URL: https://github.com/elipousson/isstatic
- Owner: elipousson
- License: cc0-1.0
- Created: 2022-11-15T04:16:23.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2026-05-07T05:34:28.000Z (about 1 month ago)
- Last Synced: 2026-05-07T07:34:31.354Z (about 1 month ago)
- Topics: rpackage, rstats
- Language: R
- Homepage: https://elipousson.github.io/isstatic/
- Size: 1.42 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE.md
Awesome Lists containing this project
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# isstatic
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[](https://www.repostatus.org/#wip)
[](http://creativecommons.org/publicdomain/zero/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](https://github.com/wch/staticimports) is also intended as a way to keep those functions standardized across projects. This package is inspired by the [stringstatic](https://github.com/rossellhayes/stringstatic/) package by Alex Rossell Hayes.
## Installation
You can install the development version of isstatic like so:
``` r
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`](https://github.com/wch/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:
```r
staticimports::import()
```
By default, this will write the functions to an `R/staticimports.R` file in your project.