Error: could not find function "corrplot"

Hi guys!

I'm running the code below in R and its working but when I try to run the same in Knime don't work.

The error message is: Loading required package: corrplot
Error: could not find function "corrplot"

The code is this 


cor.mtest <- function(mat, conf.level = 0.95){
  mat <- as.matrix(mat)
  n <- ncol(mat)
  p.mat <- lowCI.mat <- uppCI.mat <- matrix(NA, n, n)
  diag(p.mat) <- 0
  diag(lowCI.mat) <- diag(uppCI.mat) <- 1
  for(i in 1:(n-1)){
    for(j in (i+1):n){
      tmp <- cor.test(mat[,i], mat[,j], conf.level = conf.level)
      p.mat[i,j] <- p.mat[j,i] <- tmp$p.value
      lowCI.mat[i,j] <- lowCI.mat[j,i] <- tmp$[1]
      uppCI.mat[i,j] <- uppCI.mat[j,i] <- tmp$[2]
  return(list(p.mat, lowCI.mat, uppCI.mat))

res1 <- cor.mtest(mtcars,0.95)
res2 <- cor.mtest(mtcars,0.99)
corrplot(M, p.mat = res1[[1]], insig = "p-value")

I used the R Source (Workspace) and got the following error:

Loading required package: corrplot
Error: object 'M' not found

so in this case M is the missing object and not the corrplot package. So try with that node. 


Hi Mau!

I tried now and its working with R View Table (node)...I dont know why but thanks any way.

What is the difference in using the R Source and R View?



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