Hi,
Try

dat <- read.table(text="
a   b     c
0   89   4
1   93   3
0   88   5",sep="",header=TRUE) 

datNew <- within(dat,{a<-a*(100/1);c <- c*(100/5)})

#or
vec1 <- c(1,100,5)
as.data.frame(t(t(dat*(100))/vec1))


#or
sweep(dat*100,2,vec1,`/`)


A.K.



Hi, i am trying to get all the colums of my data frame to be in the same 
scale.. 

right now i have something like this... where a is on a 0-1 scale  b is on a 
100 scale and c is on a 1-5 scale 
a   b     c 
0   89   4 
1   93   3 
0   88   5 

How would i get it to a 100scale like this... 
a     b      c 
0     89     80 
100  93     60 
0     88     100 

i hope that is somewhat clear..

______________________________________________
R-help@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.

Reply via email to