I'm beginner so I have a big problem.T.T
let me show you my script
test_call = read_excel(path="E:\\matrix.xlsx", sheet="Sheet1", col_names=TRUE)
df <- data.frame(test_call)
df2 <-as.data.frame.matrix(table(df))
n <- nrow(df2)
m <- ncol(df2)
rownames(A) <- 1:n
colnames(A) <- 1:m
B <- rbind(cbind(matrix(0,n,n),df2),cbind(t(df2),matrix(0,m,m)))
First question is when I ran "n <- nrow(df2)& m <- ncol(df2)" I got the warning message like "length of 'dimnames' 1 not equal to array extent" I think I count the number of row and put those values into my row&column's name I don't know why. Second question is I got the message "length of 'dimnames' 1 not equal to array extent" when i run "B <- rbind(cbind(matrix(0,n,n),df2),cbind(t(df2),matrix(0,m,m)))" How can i solve this problem??