Hi,
I want to work with RStudio on Windows 10. And read in some excel table with read_xl function. That works and I can take a view.
Now I want to declare them as a network (as.network) from statnet. But then this error comes on: Error: Subscript cbind(i, i) is a matrix, it must be of type logical.
If I do the same things on a different computer with Windows 7, it worked. Can anyone help me??
Hi @Nane,
Looks like {statnet} requires input to be a data matrix (containing only 0,1; and with zeros on the diagonal). You haven't given us any data to check but I suspect that the read_xl() function has returned a dataframe which must be converted to a matrix first:
The excel file I used is a matrix containing only 0,1) and on my older computer (using Windows 7) the exactly same script is working.
My commends:
WissOperativeAnpass1 <- read_excel("WissOperativeAnpass.xlsx")
NetWissOperativeAnpass1 <- as.network(WissOperativeAnpass1)
summary(NetWissOperativeAnpass1)
And on my new computer (using windows 10) only this commend doens't work:
NetWissOperativeAnpass1 <- as.network(WissOperativeAnpass1)
Then it says: Error: Subscript cbind(i, i) is a matrix, it must be of type logical.
Now I tried your advise, it worked. But then the facts from my network change. For example density is with the as.network commend: 0.039160... and with your advise: 0.124060...