From 16b3be8293599fbac1999063148ac4a82318de0b Mon Sep 17 00:00:00 2001 From: hanecakr Date: Thu, 25 May 2023 08:30:32 +0200 Subject: [PATCH] lag() function removed from cor_table --- .Rproj.user/429CC01A/pcs/source-pane.pper | 2 +- .Rproj.user/429CC01A/pcs/windowlayoutstate.pper | 4 ++-- .Rproj.user/429CC01A/pcs/workbench-pane.pper | 2 +- R/cor_table.R | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.Rproj.user/429CC01A/pcs/source-pane.pper b/.Rproj.user/429CC01A/pcs/source-pane.pper index aa8cf68..ea660b4 100644 --- a/.Rproj.user/429CC01A/pcs/source-pane.pper +++ b/.Rproj.user/429CC01A/pcs/source-pane.pper @@ -1,3 +1,3 @@ { - "activeTab": 7 + "activeTab": 6 } \ No newline at end of file diff --git a/.Rproj.user/429CC01A/pcs/windowlayoutstate.pper b/.Rproj.user/429CC01A/pcs/windowlayoutstate.pper index 19090c7..3574f13 100644 --- a/.Rproj.user/429CC01A/pcs/windowlayoutstate.pper +++ b/.Rproj.user/429CC01A/pcs/windowlayoutstate.pper @@ -1,12 +1,12 @@ { "left": { - "splitterpos": 296, + "splitterpos": 275, "topwindowstate": "NORMAL", "panelheight": 937, "windowheight": 975 }, "right": { - "splitterpos": 349, + "splitterpos": 348, "topwindowstate": "NORMAL", "panelheight": 937, "windowheight": 975 diff --git a/.Rproj.user/429CC01A/pcs/workbench-pane.pper b/.Rproj.user/429CC01A/pcs/workbench-pane.pper index c38a0b3..75e70e9 100644 --- a/.Rproj.user/429CC01A/pcs/workbench-pane.pper +++ b/.Rproj.user/429CC01A/pcs/workbench-pane.pper @@ -1,5 +1,5 @@ { - "TabSet1": 4, + "TabSet1": 0, "TabSet2": 0, "TabZoom": {} } \ No newline at end of file diff --git a/R/cor_table.R b/R/cor_table.R index 2da1430..169df57 100644 --- a/R/cor_table.R +++ b/R/cor_table.R @@ -37,7 +37,7 @@ cor_table <- sort_by = "t_Ho") #c("glk", "t_St", "t_BP", "t_Ho", "r_pearson")) { # to avoid notes in CMD check - pnorm <- lag <- cor <- select <- series <- reference <- NULL + pnorm <- cor <- select <- series <- reference <- NULL ### checks x_ori <- x @@ -183,10 +183,10 @@ cor_table <- colnames(tHo_mat) <- names(y) if ("t_Ho" %in% values) { - wuch_x <- apply(x, 2, function(x) {x / lag(x)} ) + wuch_x <- apply(x, 2, function(x) {x / c(NA, x[-length(x)])} ) wuch_x <- 100 * log10(wuch_x) - wuch_y <- apply(y, 2, function(x) {x / lag(x)} ) + wuch_y <- apply(y, 2, function(x) {x / c(NA, x[-length(x)])} ) wuch_y <- 100 * log10(wuch_y) r <-