Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 缺少数据的向日葵图_R - Fatal编程技术网

R 缺少数据的向日葵图

R 缺少数据的向日葵图,r,R,似乎sunflowerplot无法处理丢失的数据 我试图编写一个cleared sunflower plot函数,该函数清除输入向量中缺失的值,并通知sunflower plot图例中每个变量缺失值的数量。代码如下: library(gplots) CleanedSunflowerPlot <- function(x,y,...){ m<-sum(is.na(x)) n <- sum(is.na(y))

似乎sunflowerplot无法处理丢失的数据

我试图编写一个cleared sunflower plot函数,该函数清除输入向量中缺失的值,并通知sunflower plot图例中每个变量缺失值的数量。代码如下:

      library(gplots)
    CleanedSunflowerPlot <- function(x,y,...){
        m<-sum(is.na(x)) 
        n <- sum(is.na(y)) 
            x <- na.omit(x)
            y <- na.omit(y)
        sunflowerplot(x,y,...)
        smartlegend(x="left", y="top",
        c( paste(m , " missing x values") , paste(n, " missing y values"))) 

    }
库(gplots)

清洁向日葵地块基于@rawr的建议:


x cbind x和y,然后删除所有缺少数据的行