Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elipousson/isstatic
A R package for Dependency-Free Object Tests
https://github.com/elipousson/isstatic
rpackage rstats
Last synced: 27 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 (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-03T01:31:14.000Z (over 1 year ago)
- Last Synced: 2024-03-26T16:11:30.554Z (8 months ago)
- Topics: rpackage, rstats
- Language: R
- Homepage: https://elipousson.github.io/isstatic/
- Size: 544 KB
- Stars: 2
- Watchers: 2
- 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
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
[![License: CC0-1.0](https://img.shields.io/badge/License-CC0_1.0-brightgreen.svg)](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")
```
## UsageTo 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.