79483678

Date: 2025-03-04 12:21:07
Score: 2
Natty:
Report link

dat <- data.frame(

names <- unique(c(dat$source, dat$target))

dat$source <- factor(dat$source, levels = names) dat$target <- factor(dat$target, levels = names)

mat <- xtabs(count ~ source + target, data = dat) mat[lower.tri(mat)] <- t(mat)[lower.tri(mat)] mat target source A B C D A 0 4 5 6 B 4 0 3 3 C 5 3 0 5 D 6 3 5 0

Reasons:
  • No code block (0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Ayushi