I have a problem when making the structure of the data.

![enter image description here](https://i.stack.imgur.com/1n8sl.png)

```
lv1<-c(5,2,8)
lv2<-c(9,3,6)
lv3<-c(5,0,2)
df<-data.frame(lv1,lv2,lv3)

```

The result in the data is the number of people under lv1, lv2 and lv3.
but I want to investigate the relationship between the number of people and different lv, so I would like to convert it look like this:

![enter image description here](https://i.stack.imgur.com/scU43.png)

```
lv<- c('lv1','lv1','lv1','lv2','lv2','lv2','lv3','lv3','lv3')
number.of.people<-(c(5,2,8,9,3,6,5,0,2))
new.df<-data.frame(lv,number.of.people)

```

Is there any code I can do that?