From 4abc21afc9553552676db227ad1d51c8d7b721c5 Mon Sep 17 00:00:00 2001 From: Alex Stivala Date: Fri, 9 Dec 2022 01:12:25 +0100 Subject: [PATCH] more debug output (why does sometimes system.time() work and sometimes you hvae to do print(system.time())??? R is such a pain --- scripts/simFitPlots.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/simFitPlots.R b/scripts/simFitPlots.R index 8b0c5f1a..dde9a0e0 100644 --- a/scripts/simFitPlots.R +++ b/scripts/simFitPlots.R @@ -615,11 +615,11 @@ build_sim_fit_plots <- function(g_obs, sim_graphs, do_subplots=FALSE, num_dyads_obs <- choose(vcount(g_obs), 2) # N*(N-1)/2 num_dyads_sim <- sapply(sim_graphs, function(h) choose(vcount(h), 2)) cat('computing observed geodesic distribution...') - system.time(obs_geodesics <- distance_table(g_obs)$res) + print(system.time(obs_geodesics <- distance_table(g_obs)$res) cat('computing simulated geodesic distributions...') - system.time(sim_geodesics <- sapply(sim_graphs, + print(system.time(sim_geodesics <- sapply(sim_graphs, function(g) distance_table(g)$res, - simplify = FALSE)) + simplify = FALSE))) maxgeodesic <- max(length(obs_geodesics), sapply(sim_geodesics, function(v) length(v))) cat("Max geodesic distance is ", maxgeodesic, "\n") @@ -756,7 +756,7 @@ build_sim_fit_plots <- function(g_obs, sim_graphs, do_subplots=FALSE, dsp = rep(0:cutoff, num_sim), count = NA) cat('computing observed dsp distribution...') - system.time(obs_dsp <- summary(net_obs ~ dsp(0:cutoff))) + print(system.time(obs_dsp <- summary(net_obs ~ dsp(0:cutoff)))) cat('computing simulated dsp distributions...') start <- Sys.time() for (i in 1:num_sim) {