In R, you can do it using the `rep`command: tab <- data.frame(value=c(1, 2, 3, 4, 5), freq=c(2, 1, 4, 2, 1)) vec <- rep(tab$value, tab$freq) This gives following result: > tab value freq 1 1 2 2 2 1 3 3 4 4 4 2 5 5 1 > vec [1] 1 1 2 3 3 3 3 4 4 5 For details, see the help file for the `rep`command by typing `?rep`.