Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow function in qgraph error edgeConnectPoints #51

Closed
lsnadeau opened this issue Feb 12, 2021 · 10 comments
Closed

Flow function in qgraph error edgeConnectPoints #51

lsnadeau opened this issue Feb 12, 2021 · 10 comments

Comments

@lsnadeau
Copy link

Hello I'm new with R and start to learn network analysis using qgraph with a data cohort that have sf36 questionnaire.
I try to do a flow diagram from one of the item and I get this error below. I don't find references about this error.
I did a qgraph call g2
g2 <- qgraph(corMat_n, graph = "glasso", layout = L2, sampleSize = nrow(Datan),
esize = 20, cut = 0.1,
minimum = 0, maximum = 1, groups = groups1,
color = c("red", "yellow", "orange", "cornflowerblue", "green", "purple", "grey", "maroon1", "chocolate3"),
borders = FALSE, vsize= 10, labels = labels1, legend = FALSE)
mtext("(b)", cex = 1.25, side = 1, line = 8.7, las = 1)

then run the flow and get an error

flow(g2, "SF 32", theme = "colorblind", vsize = 4)
Error in qgraph(object, layout = Layout, curve = Curve, edgeConnectPoints = ECP, :
Number of rows in 'edgeConnectPoints' do not match number of edges

I don't know where to look for that type of error.
Am I giving enough information?

thank you
Lyne

@SachaEpskamp
Copy link
Owner

Hi! Could you provide a reproducible example of the error?

@lsnadeau
Copy link
Author

lsnadeau commented Feb 17, 2021 via email

@SachaEpskamp
Copy link
Owner

I meant perhaps you can try to make a minimal reproducible example. See for some details here. For example, this code runs for me:

library("qgraph")

corMat_n <- matrix(0.1,6,6)
diag(corMat_n) <- 1

qgraph(corMat_n, graph = "glasso", sampleSize = 1000,
       esize = 20, cut = 0.1,
       minimum = 0, maximum = 1,  
       borders = FALSE, vsize= 10,  legend = FALSE)

If you can extend that code to the point where it reproduces your error we can figure out the problem.

@lsnadeau
Copy link
Author

lsnadeau commented Feb 22, 2021 via email

@lsnadeau
Copy link
Author

lsnadeau commented Feb 22, 2021 via email

@SachaEpskamp
Copy link
Owner

Thanks! I can replicate this. Can you try with the new devel version?


library("devtools")
install_github("sachaepskamp/qgraph")

@lsnadeau
Copy link
Author

lsnadeau commented Feb 23, 2021 via email

@SachaEpskamp
Copy link
Owner

You need to install Rtools to compile from source: https://cran.r-project.org/bin/windows/Rtools/. When asked about installing any other package from source, say "no".

@lsnadeau
Copy link
Author

lsnadeau commented Mar 7, 2021

Hello,
I installed Rtools from the link you gave. Then I ran
install_github("sachaepskamp/qgraph")
and got this

install_github("sachaepskamp/qgraph")
Downloading GitHub repo sachaepskamp/qgraph@HEAD
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All
2: CRAN packages only
3: None
4: pillar (1.4.7 -> 1.5.1 ) [CRAN]
5: isoband (0.2.3 -> 0.2.4 ) [CRAN]
6: mime (0.9 -> 0.10 ) [CRAN]
7: xfun (0.20 -> 0.21 ) [CRAN]
8: backports (1.2.0 -> 1.2.1 ) [CRAN]
9: data.table (1.13.6 -> 1.14.0) [CRAN]
10: dplyr (1.0.3 -> 1.0.5 ) [CRAN]
11: Hmisc (4.4-2 -> 4.5-0 ) [CRAN]

then I selected 1 to install ALL and got this

Enter one or more numbers, or an empty line to skip updates:1
pillar (1.4.7 -> 1.5.1 ) [CRAN]
tibble (NA -> 3.1.0 ) [CRAN]
isoband (0.2.3 -> 0.2.4 ) [CRAN]
mime (0.9 -> 0.10 ) [CRAN]
xfun (0.20 -> 0.21 ) [CRAN]
backports (1.2.0 -> 1.2.1 ) [CRAN]
data.table (1.13.6 -> 1.14.0) [CRAN]
dplyr (1.0.3 -> 1.0.5 ) [CRAN]
Hmisc (4.4-2 -> 4.5-0 ) [CRAN]
Installing 9 packages: pillar, tibble, isoband, mime, xfun, backports, data.table, dplyr, Hmisc
Installing packages into ‘C:/Users/Nancy Mayo/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)

There are binary versions available but the source versions are later:
binary source needs_compilation
pillar 1.5.0 1.5.1 FALSE
isoband 0.2.3 0.2.4 TRUE
dplyr 1.0.4 1.0.5 TRUE

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/tibble_3.1.0.zip'
Content type 'application/zip' length 824384 bytes (805 KB)
downloaded 805 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/mime_0.10.zip'
Content type 'application/zip' length 48442 bytes (47 KB)
downloaded 47 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/xfun_0.21.zip'
Content type 'application/zip' length 319648 bytes (312 KB)
downloaded 312 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/backports_1.2.1.zip'
Content type 'application/zip' length 98506 bytes (96 KB)
downloaded 96 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/data.table_1.14.0.zip'
Content type 'application/zip' length 2602450 bytes (2.5 MB)
downloaded 2.5 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/Hmisc_4.5-0.zip'
Content type 'application/zip' length 3247541 bytes (3.1 MB)
downloaded 3.1 MB

package ‘tibble’ successfully unpacked and MD5 sums checked
Error: Failed to install 'qgraph' from GitHub:
(converted from warning) cannot remove prior installation of package ‘tibble’

Should I uninstall qgraph before running this
install_github("sachaepskamp/qgraph")
?
Thank you
Lyne

@SachaEpskamp
Copy link
Owner

Sorry I missed this. You can select none when asked which packages should be updated. I think this is fixed now so I will close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants