- Thread starter trinker
- Start date
- Tags analysis data fundamental graphics

Again, nothing amazing. I'm just consolidating stuff I've found on SO, which usually just wraps an already existing function (in this case, scale).

Code:

```
scale01 <- function(x) UseMethod("scale01", x)
scale01.data.frame <- function(x)
{
m <- apply(x, 2, min, na.rm = TRUE)
M <- apply(x, 2, max, na.rm = TRUE)
as.data.frame(scale(x, m, (M-m)))
}
scale01.numeric <- function(x)
{
m <- min(x)
M <- max(x)
as.numeric(scale(x, m, (M-m)))
}
```

I also don't think do do assignments within other expressions, which can really shorten code! A+ to Dason for that.