ラスターファイルがあり、ヒストグラムとしてプロットしたいのですが、以下に示すようにhist()を使用してプロットしました。しかし、私はggplot2を使用してプロットしたいと思います。これは、公開のためにより良い方法でプロットします。
conne <- file("C:\\fined.bin","rb")
r = raster(y)
hist(r, breaks=30, main="SMD_2010",
xlab="Pearson correlation", ylab="Frequency", xlim=c(-1,1))
私はこれを試しました:
qplot(rating, data=r, geom="histogram")
エラー:
ggplot2 doesn't know how to deal with data of class RasterLayer
私は次のようなものをプロットする必要があります: