-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
45 lines (35 loc) · 1.49 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
## Introduction and Rationale
Centering and rescaling covariates is a common task prior to building
almost any sort of statistical model. Although function `scale()` will scale
scale and center numeric matrices, it always returns a `matrix`. Most model
fitting functions take data.frames. And although `scale()` will take a
data.frame as an input, it fails with an error if there is even one column
that is a categorical variable. The functions in this package provide type-stable
scaling and/or centering while ignoring
non-numeric columns. Like `scale()`, the constants used are stored as
attributes in the result, enabling automatic undoing of these operations.
This is handy for making plots after fitting the models.
My primary reason for putting this package together is to learn the process of
making an R package. But secondarily, the scaling and unscaling of covariates
is a common source of errors among students in NRES 803 Ecological Statistics.
I hope that these functions will reduce those errors and make everyone's lives
easier!
I aim for these functions to be fast and to play well with pipes.
## Installation
At the moment, the only way to install this package is from the github
repository:
```{r, eval=FALSE}
install.packages("devtools")
devtools::install_github("atyre2/scaler")
```