Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
eesys-public
BIA-Resources
Commits
0af2b005
Commit
0af2b005
authored
Dec 03, 2019
by
Weigert, Andreas
Browse files
added normalization functions
parent
b7154180
Changes
1
Hide whitespace changes
Inline
Side-by-side
Tutorial_Scripts/functions/normalization.R
0 → 100644
View file @
0af2b005
some_numbers
<-
c
(
200
,
300
,
400
,
600
,
1000
)
norm_min_max
<-
function
(
v
){
return
((
v
-
min
(
v
))
/
(
max
(
v
)
-
min
(
v
)))
}
norm_min_max
(
some_numbers
)
norm_z_score_sd
<-
function
(
v
){
return
((
v
-
mean
(
v
))
/
sd
(
v
))
}
norm_z_score_sd
(
some_numbers
)
norm_z_score_mad
<-
function
(
v
){
return
(
(
v
-
mean
(
v
))
/
(
sum
(
abs
(
v
-
mean
(
v
)))
/
length
(
v
)))
}
norm_z_score_mad
(
some_numbers
)
norm_dec
<-
function
(
v
,
j
){
return
(
v
/
(
10
^
j
))
}
norm_dec
(
some_numbers
,
3
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment