From 48ee319d0b4f7c9e7caa27cb5218252aa4aa7211 Mon Sep 17 00:00:00 2001 From: SpatLyu Date: Sat, 24 Oct 2026 00:00:01 +0800 Subject: [PATCH 1/9] swap argument order --- src/PC.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PC.cpp b/src/PC.cpp index 99eceed..f82f730 100644 --- a/src/PC.cpp +++ b/src/PC.cpp @@ -12,8 +12,8 @@ // Wrapper function to perform pattern causality analysis // [[Rcpp::export(rng = false)]] Rcpp::List RcppPC( - const Rcpp::NumericVector& target, const Rcpp::NumericVector& source, + const Rcpp::NumericVector& target, const Rcpp::IntegerVector& lib, const Rcpp::IntegerVector& pred, const Rcpp::IntegerVector& E, @@ -31,9 +31,9 @@ Rcpp::List RcppPC( bool na_comp = true) { // --- Input Conversion and Validation --- - std::vector tg = Rcpp::as>(target); std::vector sg = Rcpp::as>(source); - const size_t n_obs = tg.size(); + std::vector tg = Rcpp::as>(target); + const size_t n_obs = sg.size(); // Convert library indices (R 1-based → C++ 0-based) std::vector lib_std = Rcpp::as>(lib); From 5a04e192cbbf94c4cd81561b7fa5ea3262f43f38 Mon Sep 17 00:00:00 2001 From: SpatLyu Date: Sat, 24 Oct 2026 00:00:01 +0800 Subject: [PATCH 2/9] swap argument order --- src/PC.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PC.cpp b/src/PC.cpp index f82f730..5917357 100644 --- a/src/PC.cpp +++ b/src/PC.cpp @@ -431,8 +431,8 @@ Rcpp::List RcppPC( // Wrapper function to perform bootstrapped pattern causality analysis // [[Rcpp::export(rng = false)]] Rcpp::List RcppPCboot( - const Rcpp::NumericVector& target, const Rcpp::NumericVector& source, + const Rcpp::NumericVector& target, const Rcpp::IntegerVector& libsizes, const Rcpp::IntegerVector& lib, const Rcpp::IntegerVector& pred, @@ -456,9 +456,9 @@ Rcpp::List RcppPCboot( bool na_comp = true) { // --- Input Conversion and Validation -------------------------------------- - std::vector tg = Rcpp::as>(target); std::vector sg = Rcpp::as>(source); - const size_t n_obs = tg.size(); + std::vector tg = Rcpp::as>(target); + const size_t n_obs = sg.size(); // Convert library indices (R 1-based → C++ 0-based) std::vector lib_std = Rcpp::as>(lib); From 342d8137d33220236adabd66678a802a1367ba83 Mon Sep 17 00:00:00 2001 From: SpatLyu Date: Sat, 24 Oct 2026 00:00:01 +0800 Subject: [PATCH 3/9] swap argument order --- src/PC.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PC.cpp b/src/PC.cpp index 5917357..78754c5 100644 --- a/src/PC.cpp +++ b/src/PC.cpp @@ -1065,8 +1065,8 @@ Rcpp::IntegerVector OptPCparm(const Rcpp::NumericMatrix& Emat, // Wrapper function to perform optimal parameters search for pattern causality analysis // [[Rcpp::export(rng = false)]] Rcpp::List RcppPCops( - const Rcpp::NumericVector& target, const Rcpp::NumericVector& source, + const Rcpp::NumericVector& target, const Rcpp::IntegerVector& lib, const Rcpp::IntegerVector& pred, const Rcpp::IntegerVector& E, @@ -1086,9 +1086,9 @@ Rcpp::List RcppPCops( bool na_comp = true) { // Input Conversion and Validation -------------------------------------- - std::vector tg = Rcpp::as>(target); std::vector sg = Rcpp::as>(source); - const size_t n_obs = tg.size(); + std::vector tg = Rcpp::as>(target); + const size_t n_obs = sg.size(); // Convert library indices (R 1-based → C++ 0-based) std::vector lib_std = Rcpp::as>(lib); From 97750650ea17f87af9f2257b7d646d7d7c6f9db4 Mon Sep 17 00:00:00 2001 From: SpatLyu Date: Sat, 24 Oct 2026 00:00:01 +0800 Subject: [PATCH 4/9] swap argument order --- R/ops.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/ops.R b/R/ops.R index 909c473..988b1fe 100644 --- a/R/ops.R +++ b/R/ops.R @@ -8,7 +8,7 @@ if (is.null(lib)) lib = which(!(is.na(tv) | is.na(sv))) if (is.null(pred)) pred = lib - return(RcppPCops(tv, sv, lib, pred, E, tau, k, maximize, style, zero.tolerance, + return(RcppPCops(sv, tv, lib, pred, E, tau, k, maximize, style, zero.tolerance, dist.metric, relative, weighted, threads, higher.parallel, h, NULL, NULL)) } @@ -23,7 +23,7 @@ if (is.null(lib)) lib = which(!(is.na(tv) | is.na(sv))) if (is.null(pred)) pred = lib - return(RcppPCops(tv, sv, lib, pred, E, tau, k, maximize, style, zero.tolerance, + return(RcppPCops(sv, tv, lib, pred, E, tau, k, maximize, style, zero.tolerance, dist.metric, relative, weighted, threads, higher.parallel, 0, nb, NULL)) } @@ -37,7 +37,7 @@ if (is.null(lib)) lib = which(!(is.na(tv) | is.na(sv))) if (is.null(pred)) pred = lib - return(RcppPCops(tv, sv, lib, pred, E, tau, k, maximize, style, zero.tolerance, dist.metric, + return(RcppPCops(sv, tv, lib, pred, E, tau, k, maximize, style, zero.tolerance, dist.metric, relative, weighted, threads, higher.parallel, 0, NULL, terra::nrow(data))) } From 8a1dd912425cbdf93e0135ce2bb1cd79c7bba0df Mon Sep 17 00:00:00 2001 From: SpatLyu Date: Sat, 24 Oct 2026 00:00:01 +0800 Subject: [PATCH 5/9] swap argument order --- R/pc.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/R/pc.R b/R/pc.R index 648d1bb..508ccd6 100644 --- a/R/pc.R +++ b/R/pc.R @@ -8,10 +8,10 @@ if (is.null(pred)) pred = lib if (is.null(libsizes)) { - return(RcppPC(tv, sv, lib, pred, E, tau, style, k, zero.tolerance, + return(RcppPC(sv, tv, lib, pred, E, tau, style, k, zero.tolerance, dist.metric, relative, weighted, threads, h, NULL, NULL)) } else { - return(RcppPCboot(tv, sv, libsizes, lib, pred, E, tau, style, k, zero.tolerance, dist.metric, boot, + return(RcppPCboot(sv, tv, libsizes, lib, pred, E, tau, style, k, zero.tolerance, dist.metric, boot, replace, seed, relative, weighted, threads, higher.parallel, verbose, h, NULL, NULL)) } } @@ -27,10 +27,10 @@ if (is.null(pred)) pred = lib if (is.null(libsizes)) { - return(RcppPC(tv, sv, lib, pred, E, tau, style, k, zero.tolerance, + return(RcppPC(sv, tv, lib, pred, E, tau, style, k, zero.tolerance, dist.metric, relative, weighted, threads, 0, nb, NULL)) } else { - return(RcppPCboot(tv, sv, libsizes, lib, pred, E, tau, style, k, zero.tolerance, dist.metric, boot, + return(RcppPCboot(sv, tv, libsizes, lib, pred, E, tau, style, k, zero.tolerance, dist.metric, boot, replace, seed, relative, weighted, threads, higher.parallel, verbose, 0, nb, NULL)) } } @@ -45,10 +45,10 @@ if (is.null(pred)) pred = lib if (is.null(libsizes)) { - return(RcppPC(tv, sv, lib, pred, E, tau, style, k, zero.tolerance, dist.metric, + return(RcppPC(sv, tv, lib, pred, E, tau, style, k, zero.tolerance, dist.metric, relative, weighted, threads, 0, NULL, terra::nrow(data))) } else { - return(RcppPCboot(tv, sv, libsizes, lib, pred, E, tau, style, k, zero.tolerance, dist.metric, boot, replace, + return(RcppPCboot(sv, tv, libsizes, lib, pred, E, tau, style, k, zero.tolerance, dist.metric, boot, replace, seed, relative, weighted, threads, higher.parallel, verbose, 0, NULL, terra::nrow(data))) } } From 822c02aa0941c974c2a24983ba0aa6196c7c3c14 Mon Sep 17 00:00:00 2001 From: SpatLyu Date: Sat, 24 Oct 2026 00:00:01 +0800 Subject: [PATCH 6/9] swap argument order --- R/pc.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/pc.R b/R/pc.R index 508ccd6..5f8338e 100644 --- a/R/pc.R +++ b/R/pc.R @@ -1,4 +1,4 @@ -.pc_ts = \(data, target, source, libsizes = NULL, E = 3, k = E, tau = 1, style = 1, lib = NULL, pred = NULL, boot = 99, +.pc_ts = \(data, source, target, libsizes = NULL, E = 3, k = E, tau = 1, style = 1, lib = NULL, pred = NULL, boot = 99, replace = FALSE, seed = 42L, dist.metric = c("euclidean", "manhattan", "maximum"), zero.tolerance = max(k), relative = TRUE, weighted = TRUE, threads = length(libsizes), higher.parallel = TRUE, verbose = TRUE, h = 0, ...) { dist.metric = match.arg(dist.metric) @@ -16,7 +16,7 @@ } } -.pc_lattice = \(data, target, source, libsizes = NULL, E = 3, k = E+1, tau = 1, style = 1, lib = NULL, pred = NULL, boot = 99, +.pc_lattice = \(data, source, target, libsizes = NULL, E = 3, k = E+1, tau = 1, style = 1, lib = NULL, pred = NULL, boot = 99, replace = FALSE, seed = 42L, dist.metric = c("euclidean", "manhattan", "maximum"), zero.tolerance = max(k), relative = TRUE, weighted = TRUE, threads = length(libsizes), higher.parallel = TRUE, verbose = TRUE, detrend = FALSE, nb = NULL, ...) { if (is.null(nb)) nb = sdsfun::spdep_nb(data) @@ -35,7 +35,7 @@ } } -.pc_grid = \(data, target, source, libsizes = NULL, E = 3, k = E+1, tau = 1, style = 1, lib = NULL, pred = NULL, boot = 99, +.pc_grid = \(data, source, target, libsizes = NULL, E = 3, k = E+1, tau = 1, style = 1, lib = NULL, pred = NULL, boot = 99, replace = FALSE, seed = 42L, dist.metric = c("euclidean", "manhattan", "maximum"), zero.tolerance = max(k), relative = TRUE, weighted = TRUE, threads = length(libsizes), higher.parallel = TRUE, verbose = TRUE, detrend = FALSE, ...) { dist.metric = match.arg(dist.metric) From 9fd137152a990a11c7ff6a6a034c85d0956fa894 Mon Sep 17 00:00:00 2001 From: SpatLyu Date: Sat, 24 Oct 2026 00:00:01 +0800 Subject: [PATCH 7/9] swap argument order --- R/ops.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/ops.R b/R/ops.R index 988b1fe..2e79c04 100644 --- a/R/ops.R +++ b/R/ops.R @@ -1,4 +1,4 @@ -.ops_ts = \(data, target, source, E = 3:5, k = E, tau = 1, style = 1, lib = NULL, pred = NULL, +.ops_ts = \(data, source, target, E = 3:5, k = E, tau = 1, style = 1, lib = NULL, pred = NULL, maximize = c("dark", "positive", "negative"), dist.metric = c("euclidean", "manhattan", "maximum"), zero.tolerance = max(k), relative = TRUE, weighted = TRUE, threads = length(E), higher.parallel = TRUE, h = 0, ...) { maximize = match.arg(maximize) @@ -12,7 +12,7 @@ dist.metric, relative, weighted, threads, higher.parallel, h, NULL, NULL)) } -.ops_lattice = \(data, target, source, E = 3:5, k = E+1, tau = 1, style = 1, lib = NULL, pred = NULL, +.ops_lattice = \(data, source, target, E = 3:5, k = E+1, tau = 1, style = 1, lib = NULL, pred = NULL, maximize = c("dark", "positive", "negative"), dist.metric = c("euclidean", "manhattan", "maximum"), zero.tolerance = max(k), relative = TRUE, weighted = TRUE, threads = length(E), higher.parallel = TRUE, detrend = FALSE, nb = NULL, ...) { if (is.null(nb)) nb = sdsfun::spdep_nb(data) @@ -27,7 +27,7 @@ dist.metric, relative, weighted, threads, higher.parallel, 0, nb, NULL)) } -.ops_grid = \(data, target, source, E = 3:5, k = E+1, tau = 1, style = 1, lib = NULL, pred = NULL, +.ops_grid = \(data, source, target, E = 3:5, k = E+1, tau = 1, style = 1, lib = NULL, pred = NULL, maximize = c("positive", "negative", "dark"), dist.metric = c("euclidean", "manhattan", "maximum"), zero.tolerance = max(k), relative = TRUE, weighted = TRUE, threads = length(E), higher.parallel = TRUE, detrend = FALSE, ...) { maximize = match.arg(maximize) From 4fe975eb031b0410c3db4f531dda2c18f8694ddb Mon Sep 17 00:00:00 2001 From: SpatLyu Date: Sat, 24 Oct 2026 00:00:01 +0800 Subject: [PATCH 8/9] swap argument order --- R/RcppExports.R | 12 ++++++------ src/RcppExports.cpp | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/R/RcppExports.R b/R/RcppExports.R index fd6b831..d8c4029 100644 --- a/R/RcppExports.R +++ b/R/RcppExports.R @@ -9,15 +9,15 @@ RcppFNN <- function(target, rt, eps, lib, pred, E, tau = 1L, style = 0L, dist_me .Call(`_pc_RcppFNN`, target, rt, eps, lib, pred, E, tau, style, dist_metric, k, threads, parallel_level, nb, nrows, na_comp) } -RcppPC <- function(target, source, lib, pred, E, tau, style = 0L, num_neighbors = 4L, zero_tolerance = 0L, dist_metric = "euclidean", relative = TRUE, weighted = TRUE, threads = 1L, h = 0L, nb = NULL, nrows = NULL, na_comp = TRUE) { - .Call(`_pc_RcppPC`, target, source, lib, pred, E, tau, style, num_neighbors, zero_tolerance, dist_metric, relative, weighted, threads, h, nb, nrows, na_comp) +RcppPC <- function(source, target, lib, pred, E, tau, style = 0L, num_neighbors = 4L, zero_tolerance = 0L, dist_metric = "euclidean", relative = TRUE, weighted = TRUE, threads = 1L, h = 0L, nb = NULL, nrows = NULL, na_comp = TRUE) { + .Call(`_pc_RcppPC`, source, target, lib, pred, E, tau, style, num_neighbors, zero_tolerance, dist_metric, relative, weighted, threads, h, nb, nrows, na_comp) } -RcppPCboot <- function(target, source, libsizes, lib, pred, E, tau, style = 0L, num_neighbors = 4L, zero_tolerance = 0L, dist_metric = "euclidean", boot = 99L, replace_sampling = TRUE, seed = 42L, relative = TRUE, weighted = TRUE, threads = 1L, parallel_level = 0L, verbose = FALSE, h = 0L, nb = NULL, nrows = NULL, na_comp = TRUE) { - .Call(`_pc_RcppPCboot`, target, source, libsizes, lib, pred, E, tau, style, num_neighbors, zero_tolerance, dist_metric, boot, replace_sampling, seed, relative, weighted, threads, parallel_level, verbose, h, nb, nrows, na_comp) +RcppPCboot <- function(source, target, libsizes, lib, pred, E, tau, style = 0L, num_neighbors = 4L, zero_tolerance = 0L, dist_metric = "euclidean", boot = 99L, replace_sampling = TRUE, seed = 42L, relative = TRUE, weighted = TRUE, threads = 1L, parallel_level = 0L, verbose = FALSE, h = 0L, nb = NULL, nrows = NULL, na_comp = TRUE) { + .Call(`_pc_RcppPCboot`, source, target, libsizes, lib, pred, E, tau, style, num_neighbors, zero_tolerance, dist_metric, boot, replace_sampling, seed, relative, weighted, threads, parallel_level, verbose, h, nb, nrows, na_comp) } -RcppPCops <- function(target, source, lib, pred, E, tau, k, maximize = "positive", style = 0L, zero_tolerance = 0L, dist_metric = "euclidean", relative = TRUE, weighted = TRUE, threads = 1L, parallel_level = 0L, h = 0L, nb = NULL, nrows = NULL, na_comp = TRUE) { - .Call(`_pc_RcppPCops`, target, source, lib, pred, E, tau, k, maximize, style, zero_tolerance, dist_metric, relative, weighted, threads, parallel_level, h, nb, nrows, na_comp) +RcppPCops <- function(source, target, lib, pred, E, tau, k, maximize = "positive", style = 0L, zero_tolerance = 0L, dist_metric = "euclidean", relative = TRUE, weighted = TRUE, threads = 1L, parallel_level = 0L, h = 0L, nb = NULL, nrows = NULL, na_comp = TRUE) { + .Call(`_pc_RcppPCops`, source, target, lib, pred, E, tau, k, maximize, style, zero_tolerance, dist_metric, relative, weighted, threads, parallel_level, h, nb, nrows, na_comp) } diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index cf9090c..9733218 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -55,12 +55,12 @@ BEGIN_RCPP END_RCPP } // RcppPC -Rcpp::List RcppPC(const Rcpp::NumericVector& target, const Rcpp::NumericVector& source, const Rcpp::IntegerVector& lib, const Rcpp::IntegerVector& pred, const Rcpp::IntegerVector& E, const Rcpp::IntegerVector& tau, int style, int num_neighbors, int zero_tolerance, const std::string& dist_metric, bool relative, bool weighted, int threads, int h, Rcpp::Nullable nb, Rcpp::Nullable nrows, bool na_comp); -RcppExport SEXP _pc_RcppPC(SEXP targetSEXP, SEXP sourceSEXP, SEXP libSEXP, SEXP predSEXP, SEXP ESEXP, SEXP tauSEXP, SEXP styleSEXP, SEXP num_neighborsSEXP, SEXP zero_toleranceSEXP, SEXP dist_metricSEXP, SEXP relativeSEXP, SEXP weightedSEXP, SEXP threadsSEXP, SEXP hSEXP, SEXP nbSEXP, SEXP nrowsSEXP, SEXP na_compSEXP) { +Rcpp::List RcppPC(const Rcpp::NumericVector& source, const Rcpp::NumericVector& target, const Rcpp::IntegerVector& lib, const Rcpp::IntegerVector& pred, const Rcpp::IntegerVector& E, const Rcpp::IntegerVector& tau, int style, int num_neighbors, int zero_tolerance, const std::string& dist_metric, bool relative, bool weighted, int threads, int h, Rcpp::Nullable nb, Rcpp::Nullable nrows, bool na_comp); +RcppExport SEXP _pc_RcppPC(SEXP sourceSEXP, SEXP targetSEXP, SEXP libSEXP, SEXP predSEXP, SEXP ESEXP, SEXP tauSEXP, SEXP styleSEXP, SEXP num_neighborsSEXP, SEXP zero_toleranceSEXP, SEXP dist_metricSEXP, SEXP relativeSEXP, SEXP weightedSEXP, SEXP threadsSEXP, SEXP hSEXP, SEXP nbSEXP, SEXP nrowsSEXP, SEXP na_compSEXP) { BEGIN_RCPP Rcpp::RObject rcpp_result_gen; - Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type target(targetSEXP); Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type source(sourceSEXP); + Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type target(targetSEXP); Rcpp::traits::input_parameter< const Rcpp::IntegerVector& >::type lib(libSEXP); Rcpp::traits::input_parameter< const Rcpp::IntegerVector& >::type pred(predSEXP); Rcpp::traits::input_parameter< const Rcpp::IntegerVector& >::type E(ESEXP); @@ -76,17 +76,17 @@ BEGIN_RCPP Rcpp::traits::input_parameter< Rcpp::Nullable >::type nb(nbSEXP); Rcpp::traits::input_parameter< Rcpp::Nullable >::type nrows(nrowsSEXP); Rcpp::traits::input_parameter< bool >::type na_comp(na_compSEXP); - rcpp_result_gen = Rcpp::wrap(RcppPC(target, source, lib, pred, E, tau, style, num_neighbors, zero_tolerance, dist_metric, relative, weighted, threads, h, nb, nrows, na_comp)); + rcpp_result_gen = Rcpp::wrap(RcppPC(source, target, lib, pred, E, tau, style, num_neighbors, zero_tolerance, dist_metric, relative, weighted, threads, h, nb, nrows, na_comp)); return rcpp_result_gen; END_RCPP } // RcppPCboot -Rcpp::List RcppPCboot(const Rcpp::NumericVector& target, const Rcpp::NumericVector& source, const Rcpp::IntegerVector& libsizes, const Rcpp::IntegerVector& lib, const Rcpp::IntegerVector& pred, const Rcpp::IntegerVector& E, const Rcpp::IntegerVector& tau, int style, int num_neighbors, int zero_tolerance, const std::string& dist_metric, int boot, bool replace_sampling, int seed, bool relative, bool weighted, int threads, int parallel_level, bool verbose, int h, Rcpp::Nullable nb, Rcpp::Nullable nrows, bool na_comp); -RcppExport SEXP _pc_RcppPCboot(SEXP targetSEXP, SEXP sourceSEXP, SEXP libsizesSEXP, SEXP libSEXP, SEXP predSEXP, SEXP ESEXP, SEXP tauSEXP, SEXP styleSEXP, SEXP num_neighborsSEXP, SEXP zero_toleranceSEXP, SEXP dist_metricSEXP, SEXP bootSEXP, SEXP replace_samplingSEXP, SEXP seedSEXP, SEXP relativeSEXP, SEXP weightedSEXP, SEXP threadsSEXP, SEXP parallel_levelSEXP, SEXP verboseSEXP, SEXP hSEXP, SEXP nbSEXP, SEXP nrowsSEXP, SEXP na_compSEXP) { +Rcpp::List RcppPCboot(const Rcpp::NumericVector& source, const Rcpp::NumericVector& target, const Rcpp::IntegerVector& libsizes, const Rcpp::IntegerVector& lib, const Rcpp::IntegerVector& pred, const Rcpp::IntegerVector& E, const Rcpp::IntegerVector& tau, int style, int num_neighbors, int zero_tolerance, const std::string& dist_metric, int boot, bool replace_sampling, int seed, bool relative, bool weighted, int threads, int parallel_level, bool verbose, int h, Rcpp::Nullable nb, Rcpp::Nullable nrows, bool na_comp); +RcppExport SEXP _pc_RcppPCboot(SEXP sourceSEXP, SEXP targetSEXP, SEXP libsizesSEXP, SEXP libSEXP, SEXP predSEXP, SEXP ESEXP, SEXP tauSEXP, SEXP styleSEXP, SEXP num_neighborsSEXP, SEXP zero_toleranceSEXP, SEXP dist_metricSEXP, SEXP bootSEXP, SEXP replace_samplingSEXP, SEXP seedSEXP, SEXP relativeSEXP, SEXP weightedSEXP, SEXP threadsSEXP, SEXP parallel_levelSEXP, SEXP verboseSEXP, SEXP hSEXP, SEXP nbSEXP, SEXP nrowsSEXP, SEXP na_compSEXP) { BEGIN_RCPP Rcpp::RObject rcpp_result_gen; - Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type target(targetSEXP); Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type source(sourceSEXP); + Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type target(targetSEXP); Rcpp::traits::input_parameter< const Rcpp::IntegerVector& >::type libsizes(libsizesSEXP); Rcpp::traits::input_parameter< const Rcpp::IntegerVector& >::type lib(libSEXP); Rcpp::traits::input_parameter< const Rcpp::IntegerVector& >::type pred(predSEXP); @@ -108,17 +108,17 @@ BEGIN_RCPP Rcpp::traits::input_parameter< Rcpp::Nullable >::type nb(nbSEXP); Rcpp::traits::input_parameter< Rcpp::Nullable >::type nrows(nrowsSEXP); Rcpp::traits::input_parameter< bool >::type na_comp(na_compSEXP); - rcpp_result_gen = Rcpp::wrap(RcppPCboot(target, source, libsizes, lib, pred, E, tau, style, num_neighbors, zero_tolerance, dist_metric, boot, replace_sampling, seed, relative, weighted, threads, parallel_level, verbose, h, nb, nrows, na_comp)); + rcpp_result_gen = Rcpp::wrap(RcppPCboot(source, target, libsizes, lib, pred, E, tau, style, num_neighbors, zero_tolerance, dist_metric, boot, replace_sampling, seed, relative, weighted, threads, parallel_level, verbose, h, nb, nrows, na_comp)); return rcpp_result_gen; END_RCPP } // RcppPCops -Rcpp::List RcppPCops(const Rcpp::NumericVector& target, const Rcpp::NumericVector& source, const Rcpp::IntegerVector& lib, const Rcpp::IntegerVector& pred, const Rcpp::IntegerVector& E, const Rcpp::IntegerVector& tau, const Rcpp::IntegerVector& k, const std::string& maximize, int style, int zero_tolerance, const std::string& dist_metric, bool relative, bool weighted, int threads, int parallel_level, int h, Rcpp::Nullable nb, Rcpp::Nullable nrows, bool na_comp); -RcppExport SEXP _pc_RcppPCops(SEXP targetSEXP, SEXP sourceSEXP, SEXP libSEXP, SEXP predSEXP, SEXP ESEXP, SEXP tauSEXP, SEXP kSEXP, SEXP maximizeSEXP, SEXP styleSEXP, SEXP zero_toleranceSEXP, SEXP dist_metricSEXP, SEXP relativeSEXP, SEXP weightedSEXP, SEXP threadsSEXP, SEXP parallel_levelSEXP, SEXP hSEXP, SEXP nbSEXP, SEXP nrowsSEXP, SEXP na_compSEXP) { +Rcpp::List RcppPCops(const Rcpp::NumericVector& source, const Rcpp::NumericVector& target, const Rcpp::IntegerVector& lib, const Rcpp::IntegerVector& pred, const Rcpp::IntegerVector& E, const Rcpp::IntegerVector& tau, const Rcpp::IntegerVector& k, const std::string& maximize, int style, int zero_tolerance, const std::string& dist_metric, bool relative, bool weighted, int threads, int parallel_level, int h, Rcpp::Nullable nb, Rcpp::Nullable nrows, bool na_comp); +RcppExport SEXP _pc_RcppPCops(SEXP sourceSEXP, SEXP targetSEXP, SEXP libSEXP, SEXP predSEXP, SEXP ESEXP, SEXP tauSEXP, SEXP kSEXP, SEXP maximizeSEXP, SEXP styleSEXP, SEXP zero_toleranceSEXP, SEXP dist_metricSEXP, SEXP relativeSEXP, SEXP weightedSEXP, SEXP threadsSEXP, SEXP parallel_levelSEXP, SEXP hSEXP, SEXP nbSEXP, SEXP nrowsSEXP, SEXP na_compSEXP) { BEGIN_RCPP Rcpp::RObject rcpp_result_gen; - Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type target(targetSEXP); Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type source(sourceSEXP); + Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type target(targetSEXP); Rcpp::traits::input_parameter< const Rcpp::IntegerVector& >::type lib(libSEXP); Rcpp::traits::input_parameter< const Rcpp::IntegerVector& >::type pred(predSEXP); Rcpp::traits::input_parameter< const Rcpp::IntegerVector& >::type E(ESEXP); @@ -136,7 +136,7 @@ BEGIN_RCPP Rcpp::traits::input_parameter< Rcpp::Nullable >::type nb(nbSEXP); Rcpp::traits::input_parameter< Rcpp::Nullable >::type nrows(nrowsSEXP); Rcpp::traits::input_parameter< bool >::type na_comp(na_compSEXP); - rcpp_result_gen = Rcpp::wrap(RcppPCops(target, source, lib, pred, E, tau, k, maximize, style, zero_tolerance, dist_metric, relative, weighted, threads, parallel_level, h, nb, nrows, na_comp)); + rcpp_result_gen = Rcpp::wrap(RcppPCops(source, target, lib, pred, E, tau, k, maximize, style, zero_tolerance, dist_metric, relative, weighted, threads, parallel_level, h, nb, nrows, na_comp)); return rcpp_result_gen; END_RCPP } From daf9237295764ae3783f7bae5316cecee59d4804 Mon Sep 17 00:00:00 2001 From: SpatLyu Date: Sat, 24 Oct 2026 00:00:01 +0800 Subject: [PATCH 9/9] swap argument order --- man/ops.Rd | 10 +++++----- man/pc.Rd | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/man/ops.Rd b/man/ops.Rd index dbc6cff..270b816 100644 --- a/man/ops.Rd +++ b/man/ops.Rd @@ -9,8 +9,8 @@ \usage{ \S4method{ops}{data.frame}( data, - target, source, + target, E = 3:5, k = E, tau = 1, @@ -30,8 +30,8 @@ \S4method{ops}{sf}( data, - target, source, + target, E = 3:5, k = E + 1, tau = 1, @@ -52,8 +52,8 @@ \S4method{ops}{SpatRaster}( data, - target, source, + target, E = 3:5, k = E + 1, tau = 1, @@ -74,10 +74,10 @@ \arguments{ \item{data}{Observation data.} -\item{target}{Integer of column indice for the target variable.} - \item{source}{Integer of column indice for the source variable.} +\item{target}{Integer of column indice for the target variable.} + \item{E}{(optional) Embedding dimensions.} \item{k}{(optional) Number of nearest neighbors used for projection.} diff --git a/man/pc.Rd b/man/pc.Rd index 5242a5f..f3bec9e 100644 --- a/man/pc.Rd +++ b/man/pc.Rd @@ -9,8 +9,8 @@ \usage{ \S4method{pc}{data.frame}( data, - target, source, + target, libsizes = NULL, E = 3, k = E, @@ -34,8 +34,8 @@ \S4method{pc}{sf}( data, - target, source, + target, libsizes = NULL, E = 3, k = E + 1, @@ -60,8 +60,8 @@ \S4method{pc}{SpatRaster}( data, - target, source, + target, libsizes = NULL, E = 3, k = E + 1, @@ -86,10 +86,10 @@ \arguments{ \item{data}{Observation data.} -\item{target}{Integer of column indice for the target variable.} - \item{source}{Integer of column indice for the source variable.} +\item{target}{Integer of column indice for the target variable.} + \item{libsizes}{(optional) Number of observations used.} \item{E}{(optional) Embedding dimensions.}