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
matlab_mann_kendall <- function(V, | |
alpha = 0.05) { | |
alpha <- alpha/2 | |
n <- length(V) | |
S <- 0 | |
for (i in 1:(n-1)) { | |
for(j in (i+1):n) { | |
S <- S + sign(V[j] - V[i]) |
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
nmToRGB: function(wavelength){ | |
var Gamma = 0.80, | |
IntensityMax = 255, | |
factor, red, green, blue; | |
if((wavelength >= 380) && (wavelength<440)){ | |
red = -(wavelength - 440) / (440 - 380); | |
green = 0.0; | |
blue = 1.0; | |
}else if((wavelength >= 440) && (wavelength<490)){ | |
red = 0.0; |
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
# adding on to Mike Love's analysis of data here: | |
# https://twitter.com/mikelove/status/1118595655608483843 | |
# Data source is: | |
# https://www.cell.com/cms/10.1016/j.cell.2014.12.020/attachment/fb539453-989f-49e5-b880-34cf88151add/mmc5.xlsx | |
library(readxl) | |
x <- read_excel("mmc5.xlsx", skip = 1) | |
names(x)[12:13] <- c("ci_95_low","ci_95_high") |
NewerOlder