[R] Scaling data

baptiste auguie baptiste.auguie at googlemail.com
Mon Sep 28 12:15:12 CEST 2009


Try this,

library(ggplot2)

apply(matrix(10*rnorm(10),2), 1, ggplot2::rescale)

HTH,

baptiste

2009/9/28 Dry, Jonathan R <Jonathan.Dry at astrazeneca.com>:
> Hello all
>
> I have a data frame representing a matrix of data.  For each of my variables (rows) I want to scale the data between 0 (representing the minimum value in that row) and 1 (representing the maximum value in that row).  I was wondering if there is a simple function anywhere that does this?
>
> Jonathan
>
>
>
> --------------------------------------------------------------------------
> AstraZeneca UK Limited is a company incorporated in Engl...{{dropped:21}}
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>




More information about the R-help mailing list