Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想从 R 中的三个 2D 矩阵创建一个 RGB 图像。我知道matlab有一个类似的帖子,但是我无法将这个问题转化为 R 世界。
我已经尝试了不同的软件包,例如用于创建 3D 数组的 abind,尝试使用 writeJPEG 将其转换为 JPEG。但这没有用-
很感谢任何形式的帮助!
尝试?rgb,
?rgb
r <- matrix(runif(9, 0, 1), 3) g <- matrix(runif(9, 0, 1), 3) b <- matrix(runif(9, 0, 1), 3) col <- rgb(r, g, b) dim(col) <- dim(r) library(grid) grid.raster(col, interpolate=FALSE)