Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flippiecoetser/scale
Scale X and Y values when using R plot()
https://github.com/flippiecoetser/scale
Last synced: 4 days ago
JSON representation
Scale X and Y values when using R plot()
- Host: GitHub
- URL: https://github.com/flippiecoetser/scale
- Owner: FlippieCoetser
- License: mit
- Created: 2023-10-21T15:40:10.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-05T11:27:16.000Z (11 months ago)
- Last Synced: 2024-02-05T16:23:23.725Z (11 months ago)
- Language: R
- Size: 75.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Scale Package
This package is used to scale the image and intended to decouple the range of x and y coordinates by providing a frame size. For example if the maximum x and y coordinates is 1000mm, then the scaler can be used to scale any input x or y values with reference to this maximum value.
### Example:
1. Create new instance of `Scaler` using a `list` with maximum x and y coordinate values:
```r
scale <- list(x = 1000, y = 1000) |> Scaler::Scaler()
```2. Define the input x and y values:
```r
coordinates <- data.frame(x = c(100, 200, 300), y = c(100, 200, 300))
```3. Scale the input coordinates:
```r
scaled.coordinates <- coordinates |> scale[['Coordinates']]()
```## Installation
At this time of writing this README, this package is not available on CRAN. However, it can be installed from GitHub or build and installed locally.
### Install from GitHub
1. Use devtools
```r
devtools::install_github("https://github.com/FlippieCoetser/Scale")
```### Build and install locally
1. Clone the repository
```bash
git clone https://github.com/FlippieCoetser/Scale.git
```2. Generate `.tar.gz` file
```r
devtools::build()
```3. Install package from `.tar.gz` file
```r
install.packages("path_to_file/tar_gz_file", repos = NULL, type = "source")
```