'Plot each sample in a new plot in R
I have quick question, I do I take these type of data and loop through and put each datapoint into a new plot?
quantity <- c(3,5,2)
names(quantity) <- c("apples","bananas", "pears")
plot(quantity)
png(file = Path, width =4, height =4, units = "in", res = 600)
par(mfrow = c(3,3)
for (i in names(quantity)){
print(i)
plot(x = quantity[i], y = names(quantity)[i])
}
dev.off()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
