Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/65.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_Ggplot2_Lattice_Kernel Density - Fatal编程技术网

在R中分层密度图而不使用密度()

在R中分层密度图而不使用密度(),r,ggplot2,lattice,kernel-density,R,Ggplot2,Lattice,Kernel Density,我使用KernSmooth软件包计算并绘制了高斯核密度估计值,如下所示: x <- MyData$MyNumericVector h <- dpik(x) est <- bkde(x, bandwidth=h) plot(est, type='l') x您可以使用geom\u-line: m <- ggplot(NULL, aes(x=bkde(movies$votes)$x,y=bkde(movies$votes)$y)) + geom_line() pr

我使用KernSmooth软件包计算并绘制了高斯核密度估计值,如下所示:

 x <- MyData$MyNumericVector
 h <- dpik(x)
 est <- bkde(x, bandwidth=h)
 plot(est, type='l')

x您可以使用
geom\u-line

 m <- ggplot(NULL, aes(x=bkde(movies$votes)$x,y=bkde(movies$votes)$y)) + geom_line()
 print(m)

m您可以使用
geom\u-line

 m <- ggplot(NULL, aes(x=bkde(movies$votes)$x,y=bkde(movies$votes)$y)) + geom_line()
 print(m)

m对于那些感兴趣的人来说,下面是代码的结果:
ggplot()+geom_线(aes(x=bkde(MyFirstDataframe$MyNumericVector,bandwidth=h)$x,y=bkde(MyFirstDataframe$MyNumericVector,bandwidth=h)$y))+geom_线(aes(x=bkde(mysecondataframe$MyNumericVector,bandwidth=h)$x,y=bkde)(MySecondDataframe$MyNumericVector,带宽=h)$y)
对于感兴趣的人,下面是代码的结果:
ggplot()+geom_线(aes(x=bkde(MyFirstDataframe$MyNumericVector,带宽=h)$x,y=bkde(MyFirstDataframe$MyNumericVector,带宽=h)$y)+geom_线(aes(x=bkde(MySecondDataframe$MyNumericVector,带宽=h)$x,y=bkde(MySecondDataframe$MyNumericVector,带宽=h)$y))