FlippieCoetser / Scale

Scale X and Y values when using R plot()

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:
scale <- list(x = 1000, y = 1000) |> Scaler::Scaler()
  1. Define the input x and y values:
coordinates <- data.frame(x = c(100, 200, 300), y = c(100, 200, 300))
  1. Scale the input coordinates:
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
devtools::install_github("https://github.com/FlippieCoetser/Scale")

Build and install locally

  1. Clone the repository
git clone https://github.com/FlippieCoetser/Scale.git
  1. Generate .tar.gz file
devtools::build()
  1. Install package from .tar.gz file
install.packages("path_to_file/tar_gz_file", repos = NULL, type = "source")

About

Scale X and Y values when using R plot()

License:MIT License


Languages

Language:R 100.0%