rm(list=ls())
setwd('Desktop')

library(foreign)

#Scaling
data1<-read.spss("Data_Alpha_Omega_Cohort.sav", to.data.frame=T)

do.my.computation <- function(x){
  scale(log(x))
}
y <- apply(data1[,c(10:240)],2,do.my.computation)
colnames(y) <- paste0(colnames(y),"_LNscaled")
Result<-cbind(data1, y)

write.table(Result,"Desktop/Alpha_Omega_Cohort_Scaled.txt",col.names=T,row.names=F, sep="\t", quote=F)