-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
See gitlab commit entitled "Improved Scaling Function". Essentially, not only can the scaling function be vectorized, but the heatmap function can be passed any function for normalizing.
This is the function that should be used to normalize:
normalize <- function(x) {
x <- as.matrix(x)
minAttr=apply(x, 1, min)
maxAttr=apply(x, 1, max)
x <- sweep(x, 1, minAttr, FUN="-")
x=sweep(x, 1, maxAttr-minAttr, "/")
return (x)
}
Taken from Lui Kimman (https://stats.stackexchange.com/users/77829/lui-kimman), How to normalize data to 0-1 range?, URL (version: 2015-05-22): https://stats.stackexchange.com/q/153544
Modified to go by row instead of column.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels