I'm trying to re-arrange my data. Here's an example to illustrate--I'm hoping that there's an easy way to alter the tibble to form the matrix. The matrix could also be a tibble, though I'd want to add 'year' as factor (6th column). Ideally, you'd be able to reverse this. 

```
library(tidyverse)

set.seed(112)
n <- sample(3:36, 15, replace = T)
year <- rep(2000:2002, 5)
lic <- rep(c("imp", "proc", "rec", "whl", "ret"), 3)
d1 <- as_tibble(cbind(year, lic, n))
colnames(d1) <- c("year", "license", "n")

d1 <- d1 %>% 
  mutate(year = as.integer(year), license = as.character(license), n = as.numeric(n))

set.seed(112)
d2 <- matrix(sample(3:36, 15, replace = T), ncol = 5, byrow = T)
colnames(d2) <- c("imp", "proc", "rec", "whl", "ret")
rownames(d2) <- c(2000:2002)

```

I'd like to be able to convert d1 to d2, ideally in a way comparable to transposing a matrix using `t()`. 

Thanks