Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jsugarelli/tagr
A package for tagging and organizing objects in R
https://github.com/jsugarelli/tagr
Last synced: 8 days ago
JSON representation
A package for tagging and organizing objects in R
- Host: GitHub
- URL: https://github.com/jsugarelli/tagr
- Owner: jsugarelli
- Created: 2023-08-10T19:00:40.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-09-03T12:40:42.000Z (over 1 year ago)
- Last Synced: 2024-11-14T18:11:47.421Z (28 days ago)
- Language: R
- Size: 7.81 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - jsugarelli/tagr - A package for tagging and organizing objects in R (R)
README
# tagsr: R Package for Object Tagging
`tagsr` provides functions to manage tags associated with R objects. You can add, remove, check, list, and clean tags on any R object in the environment.
## 1. Installation
```R
# install.packages("tagr", dependencies = TRUE)
```## 2. Overview
The `tagsr` package allows users to:
- Add tags to objects.
- Check if an object has specific tags.
- List all objects in an environment by their tags.
- Remove tags from objects.
- Retrieve tags associated with an object.
- Clean the 'tags' attribute from an object.
- Remove objects from an environment based on their tags.## 3. Getting Started
Below are a few quick examples to get you started:
### Adding Tags
```R
x <- c(1, 2, 3)
add_tags(x, "foo", "bar")
```### Checking Tags
```R
x <- c(1, 2, 3)
add_tags(x, "foo", "bar")
has_tag(x, "foo") # Returns TRUE
```### Listing Objects by Tag
```R
x <- c(1, 2, 3)
y <- matrix(1:9, nrow = 3)
z <- "hello world"
add_tags(x, "foo")
add_tags(y, "bar")
add_tags(z, "baz")
ls_bytag("foo")
```### Removing Tags
```R
x <- 1:10
add_tags(x, "numbers", "positive")
untag(x, "positive") # Removes the "positive" tag
```### Retrieving Tags
```R
x <- 5
add_tags(x, "important", "numeric")
tags(x) # Returns "important, numeric"
```For more detailed documentation and examples, refer to the individual function documentation using the `help()` or `?` function in R.