This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Data for column attributes | |
Y0 = 1:20 + rnorm(100,sd=3) | |
Y1 = 1:20 + rnorm(100,sd=2) | |
Y2 = 1:20 + rnorm(100,sd=2) | |
Y3 = 1:20 + rnorm(100,sd=2) | |
Y4 = 1:20 + rnorm(100,sd=2) | |
Y5 = 1:20 + rnorm(100,sd=3) | |
Y6 = 1:10 + rnorm(100,sd=3) | |
Y7 = 1:10 + rnorm(100,sd=2) | |
Y8 = 1:20 + rnorm(100,sd=1) | |
#Create Data Frame | |
data <- data.frame(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) | |
#sample few records | |
head(data) | |
#Ways to normalize Data | |
data$Y0 = (x-min(data$Y0))/(max(data$Y0)-min(data$Y0)) | |
#Raises Y to the power of 3 | |
data$Y1 <- (data$Y1)^3 | |
#Takes the ninth root of Y | |
data$Y2 <- (data$Y2)^(1/9) | |
#Takes the natural logarithm (ln) of Y | |
data$Y3 <- log(data$Y3) | |
#Takes the base-10 logarithm of Y | |
data$Y4 <- log10(data$Y4) | |
#Raises the constant e to the power of Y | |
data$Y5 <- exp(data$Y5) | |
#Finds the absolute value of Y | |
data$Y6 <- abs(data$Y6) | |
#Calculates the sine of Y | |
data$Y7 <- sin(data$Y7) | |
#Calculates the inverse sine (arcsine) of Y | |
data$Y8 <- asin(data$Y8) | |
#check modified data | |
head(data) |
Happy Learning!!!
No comments:
Post a Comment