I am trying to install the brainconn package. I do not know whether something went wrong during installation, but I used the following options:
remotes::install_github("sidchop/brainconn", force = TRUE,
build_vignettes = TRUE, build = FALSE)
When I run
library(brainconn)
x <- example_unweighted_undirected
brainconn(atlas ="schaefer300_n7", conmat= as.data.frame(x), node.size = 3, view="ortho")
this returns the following error:
Error in `handlers[[1L]]()`:
! No layout function defined for objects of class <matrix>
and moreover, after installation, by running the help() of function with ?brainconn I can see
image
I cannot understand what it is going wrong. Can anyone suggest some workaround? Thanks

That was mentioned in
sidchop/brainconnissue 27, and supposed to be fixed with PR 28:But, as you have seen, it is not enough.
Note that issue 31 reports a similar problem, on macOS 13.6.1 with R 4.3.1.
So the platform/OS might be important.
From the code alone (
brainconn.R):conmatparameter to a matrix usingas.matrix(conmat). So, it should accept a data frame or a matrix, and it will convert it to a matrix internally if it is not already one.isSymmetric.matrix(conmat). If the matrix is symmetric, it setsdirected <- FALSE; otherwise,directed <- TRUE. That influences whether the function expects to plot undirected or directed edges.all.nodesisFALSE, it will only include nodes with edges. That is done by checking each row and column in theconmatfor non-zero values.conmatusing thethranduthrparameters to exclude edges below or above certain values.So make sure that:
conmatis of the correct dimensions, corresponding to the number of regions in the atlas.ggraph,cowplot,grid, andOpenImageR, are correctly installed and loaded.