Skip to content

Commit

Permalink
more debug output (why does sometimes system.time() work
Browse files Browse the repository at this point in the history
and sometimes you hvae to do print(system.time())??? R is such a pain
  • Loading branch information
stivalaa committed Dec 9, 2022
1 parent a2e4df7 commit 4abc21a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/simFitPlots.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 4abc21a

Please sign in to comment.