From 16a1405f16336fe6da2d1ff8f4bfef90d37ca228 Mon Sep 17 00:00:00 2001 From: Niclas Date: Tue, 20 Jan 2026 15:13:06 +0100 Subject: [PATCH] Bug fix with sapply --- R/graphon_distribution.R | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/R/graphon_distribution.R b/R/graphon_distribution.R index 9587847..5bf76bb 100644 --- a/R/graphon_distribution.R +++ b/R/graphon_distribution.R @@ -67,8 +67,7 @@ pgraphon <- function( dev_mat <- outer(y, inner_products, "-") # Apply CDF Fv to each deviation - # With sapply we do not have to assume that Fv is vectorized - cdf_values <- sapply(dev_mat, Fv) + cdf_vals <- Fv(dev_mat) # Row means give the empirical expectation for each y_j out <- rowMeans(cdf_vals) @@ -140,8 +139,7 @@ dgraphon <- function( dev_mat <- outer(y, inner_products, "-") # Apply the density function to each y[j] - # With sapply we do not have to assume that fv is vectorized - dens_vals <- sapply(dev_mat, fv) + dens_vals <- fv(dev_mat) # Row means give the empirical expectation for each y_j out <- rowMeans(dens_vals)