[R] Mapping data onto 1-10 score

Jim Lemon jim at bitwrit.com.au
Wed Jul 16 01:33:30 CEST 2008


On Tue, 2008-07-15 at 05:16 -0700, rcoder wrote:
> Hi everyone,
> 
> I want to score a set of data (-ve to +ve) using a 0-10 scale. I have the
> data in an R matrix, so I need to add another column, containing the scores
> and resave.
> 
Hi rcoder,
Maybe rescale (plotrix package) is what you want:

testmat<-matrix(rnorm(10),ncol=1)
testmat<-cbind(testmat[,1],rescale(testmat[,1],c(0,10)))
testmat

Jim



More information about the R-help mailing list