generateImage {Cardinal} | R Documentation |
Generates a simulated image of spectral signals.
generateImage(data = factor(1), coord = expand.grid( x = 1:max(1, nrow(data)), y = 1:max(1, ncol(data))), peaks = length(levels(as.factor(data))), delta = 10, as = c("SImageSet", "MSImageSet"), ...)
data |
Either a |
coord |
A |
peaks |
The number of peaks in the signal. |
delta |
The effect size of the difference between peaks differentiating different regions in the image (as specified by |
as |
Should the output object be an |
... |
Additional arguments to pass to |
An SImageSet
or an MSImageSet
.
Kylie A. Bemis
data <- matrix(c(NA, NA, 1, 1, NA, NA, NA, NA, NA, NA, 1, 1, NA, NA, NA, NA, NA, NA, NA, 0, 1, 1, NA, NA, NA, NA, NA, 1, 0, 0, 1, 1, NA, NA, NA, NA, NA, 0, 1, 1, 1, 1, NA, NA, NA, NA, 0, 1, 1, 1, 1, 1, NA, NA, NA, NA, 1, 1, 1, 1, 1, 1, 1, NA, NA, NA, 1, 1, NA, NA, NA, NA, NA, NA, 1, 1, NA, NA, NA, NA, NA), nrow=9, ncol=9) set.seed(1) x <- generateImage(data) plot(x, pixel=1) image(x, feature=1) coord <- expand.grid(x=1:nrow(data), y=1:ncol(data)) data2 <- as.factor(data[is.finite(data)]) coord2 <- coord[is.finite(data),] set.seed(1) x2 <- generateImage(data=data, coord=coord, as="MSImageSet") plot(x, pixel=1) image(x2, feature=1)