I have a data frame like the following:

```
df = data.frame(name = c("chr", "test"), ncol = c(2, 3))

```

However, for input into a function (ComplexHeatmap), I need a list like the following:

```
list(chr = list(ncol = 2), test = list(ncol = 3))

```

What is the easiest way to convert from this data frame into a list of this format? Doing `as.list` does not get the right format. 

Thanks!
Jack