Horje
normalization in r Code Example
normalization in r
# creating a normalize function for easy convertion.
normalize <- function(x) {
return ((x - min(x)) / (max(x) - min(x))) } 

# lapply creates list that is why it is converted to dataframe and it
# applies defined fundtion (which is 'normalize') to all the list values
# which is here column 2 to 8 as first column is target/response.
df.norm<- as.data.frame(lapply(df, normalize)) 




17

Related
how to change column names in r Code Example how to change column names in r Code Example
rename columns based on a variable in r Code Example rename columns based on a variable in r Code Example
rename variables in r Code Example rename variables in r Code Example
remove elements from character vector in r Code Example remove elements from character vector in r Code Example
loop through list in r Code Example loop through list in r Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11