Can't run code when deleting first line

Hi!
I got a question concerning a code in R. I get an error if I run the first line, but i get my expected results if i run the second line and skip the first one. However when i delete the first line, i cannot run the second line anymore and get the error :Error in -*tmp* : invalid argument to unary operator

B<-matrix(,nrow33)
b <- function(B,I) {
        I<- diag(33)
        B<-(I-C)^(-1)
        print(B)
}
result<-b()
result<-as.data.frame(result) #describes the indirect effects
1 Like

Hi @Komuna, check that you run before this lines, the line of contain nrow33 because the next code is a sequence a use other objects like nrow33, B, I,C.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.