i have all necessary files as per toy examples, i made circle with my data but when comes to chord_data it shows error. the error i have got is
Error in [<-
(*tmp*
, g, p, value = ifelse(M[g] %in% sub2$genes, 1, : subscript out of bounds
as per my search(web), in the above lines it should be sub2$genes, 1,0, but zero is missing in this error. i am new to R and i could not understand the source they given bellow is, if(is.vector(genes)){ M <- genes[genes%in%unique(subData$genes)] mat <- matrix(0, ncol = length(process), nrow = length(M)) rownames(mat) <- M colnames(mat) <- process for (p in 1:length(process)){ sub2 <- subset(subData, BPprocess == process[p]) for (g in 1:length(M)) mat[g, p] <- ifelse(M[g]%in%sub2$genes, 1, 0) } }else{ genes <- subset(genes, genes %in% unique(subData$genes)) N <- length(process) + 1 M <- genes[,1] mat <- matrix(0, ncol = N, nrow = length(M)) rownames(mat) <- M colnames(mat) <- c(process, 'logFC') mat[,N] <- genes[,2] for (p in 1:(N-1)){ sub2 <- subset(subData, BPprocess == process[p]) for (g in 1:length(M)) mat[g, p] <- ifelse(M[g]%in%sub2$genes, 1, 0)
can anyone understand the codes, kindly help me to solve this, thanks in advance