statistics - Increasing barplot values in R -


i have managed "declare" empty barplot shown below using command:

barplot(c(0, 0, 0, 0, 0), names.arg = c("a", "b", "c", "d", "e"), ylim = c(0,1000))  

enter image description here

how can "add" values bars such can achieve this:enter image description here

you can this, though not ideal:

dat <- rep(na,5) barplot(dat, names.arg = c("a", "b", "c", "d", "e"), ylim = c(0,1000))  barplot(replace(rep(na,5),1,100), ylim = c(0,1000), yaxt="n", add=true) #                         ^---- position of new bar #                             ^------value of new bar 

this won't work perfectly, if example want overwrite old bar lower value, close enough.

generally you'd better off saving data , redrawing entire plot each time.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -