Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

Why can i not stack one row on top of another?

$
0
0

I am trying to make an column called ID that contains 5000 rows to act as an identification column for observations on 20 individuals. I want there to be 200 observations for each of the first 10 individuals, and 300 observations for the next ten individuals (because I dont want the same number of observations for each individual). So I made two separate columns:

ID <- data.frame(ID=rep(c(12,122,242,329,595,130,145,245,654,878), each = 200))
ID2 <- data.frame(ID=rep(c(863,425,24,92,75,3,200,300,40,500), each = 300))

Why am I unable to stack one on top of the other (making a single column with all individuals) using rbind?

ID <- rbind(c(ID,ID2))

Viewing all articles
Browse latest Browse all 201839

Trending Articles