R: scatterplot from list -


i have data similar following:

a <- list("1999"=c(1:50), "2000"=rep(35, 20), "2001"=c(100, 101, 103)) 

i want make scatterplot x axis years (1999, 2000, 2001 given list names) , y axis value within each list. there easy way this? can achieve close want simple boxplot(a), i'd scatterplot rather boxplot.

you create data frame year in 1 column , value in other, , plot appropriate columns:

b <- data.frame(year=as.numeric(rep(names(a), sapply(a, length))), val=unlist(a)) plot(b) 

enter image description here


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -