Graphics coordinates in R

I want to get the coordinates from the "barplot" function, but prevent the launch of the graphics device.

When I run the commands,

x <- c(10, 23, 20)
y <- barplot(x)

barplot coordinates are stored in y, and the bar graph appears at the same time. However, I do not want to start the graphics device, what should I do?

Thank.

+3
source share
1 answer

This is just an option barplot, as indicated in the help. You just need to do this:

y <- barplot(x, plot=FALSE)
+5
source

All Articles