Home > OS >  Scatterplot age against no y variable
Scatterplot age against no y variable

Time:08-10

I am trying to recreate a graph like below using R to visualize the age distribution of a sample with no success. It is a scatterplot of age, which I assume has been jittered or something similar to spread out the values up the y axis, and there is no y variable.

Any help would be much appreciated!

age distribution scatterplot

CodePudding user response:

If you are trying to do an scatterplot,

set.seed(5)

ages <- rnorm(100,mean=50, sd=7)
random_values <- rnorm(100, 0, 7) 

plot(ages, random_values)

If you have age as a single variable you always can do an Histogramm

hist(ages)

If you have number of t by age, you may be want to do a pyramid population plot

  • Related