When using data with only one variable besides timestamp, de function transform_data() gives an error:
library(tidyverse) library(oddwater) data("data_sandy_anom") data <- data_sandy_anom[,c("Timestamp", "Cond")] data <- tidyr::drop_na(data) trans_data <- oddwater::transform_data(data)
Error in dimnames(x) <- dn : length of 'dimnames' [2] not equal to array extent
Suggestion to add colnames to the matrix data_var explicitly and use as.matrix() on the transformation vectors e.g.:
colnames(data_var) <- colnames(data)[!(colnames(data) %in% time_col)]
der_log_bounded <- rbind( rep(NA, ncol(data_var)), as.matrix(diff_log_series[2:n, ] / as.numeric(time_bound)))
When using data with only one variable besides timestamp, de function transform_data() gives an error:
library(tidyverse) library(oddwater) data("data_sandy_anom") data <- data_sandy_anom[,c("Timestamp", "Cond")] data <- tidyr::drop_na(data) trans_data <- oddwater::transform_data(data)Error in dimnames(x) <- dn : length of 'dimnames' [2] not equal to array extentSuggestion to add colnames to the matrix data_var explicitly and use as.matrix() on the transformation vectors e.g.:
colnames(data_var) <- colnames(data)[!(colnames(data) %in% time_col)]der_log_bounded <- rbind( rep(NA, ncol(data_var)), as.matrix(diff_log_series[2:n, ] / as.numeric(time_bound)))