Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Zac2
data_at_time_1 <- read.table(text = 'Date lon lat uwnd vwnd 2008/12/31 -67.25 -55.75 8.2 -2.6 2009/01/01 -69.75 -55.75 -7.9 1.2 2009/01/02 -69.25 -55.75 1.4 4.9 2009/01/03 -68.75 -55.75 -7.8 2.3 2009/01/04 -68.25 -55.25 8.9 -1.2 2009/01/05 -67.75 -55.25 -9.1 0.8 2009/01/06 -67.25 -55.25 3.0 1.3 2009/01/07 -71.75 -54.75 -1.8 -1.6 2009/01/08 -70.75 -54.75 8.7 0.2 2009/01/09 -70.25 -54.75 -3.9 1.4 2009/01/10 -70.75 -54.75 0.0 0.0 2009/01/11 -69.75 -54.75 -2.8 3.4', header = TRUE) data_at_time_1 X = data_at_time_1[4] Y= data_at_time_1[5] head(X) head(Y) m <- 1 for (i in 1:length(X)){ p <- X[i] q <- Y[i] temporary_function <- function(p, q) { if ((p > 0) & (q > 0)) { (270 - ((180/pi)*(atan(q/p)))) } else if ((p > 0) & (q < 0)) { (270 - ((180/pi)*(atan(q/p)))) } else if ((p < 0) & (q > 0)) { (90 - ((180/pi)*(atan(q/p)))) } else if ((p < 0) & (q <0)) { (90 - ((180/pi)*(atan(q/p)))) } else if ((p == 0) || (q == 0)) { 90 } else { 0 } } mapply(FUN = temporary_function, X, Y) JJJ = ((mapply(FUN = temporary_function, X, Y))) } print(JJJ) i KKK <- matrix(JJJ, nrow = length(X), byrow = TRUE) # KKK <- matrix(JJJ, nrow = n, byrow = TRUE) # to get results for desired n rows print(KKK)
run
|
edit
|
history
|
help
0
26-08-2020AjusteCurvab
26-08-2020AjusteCurvaLineariza
2q
2
Test
3dgraphics-and-curvesb
SAMPLING
5 # SUMMARY PART B
Critical correlation value calculation
Hiring Discrimination