I have a tibble with 1d list columns which I unnest_wider into individual columns. Afterwards I try to save the tibble with write_csv.
fitted_cosinors = fitted_cosinors %>%
unnest_wider(
col = c(time_of_high, high, time_of_low, low),
names_sep = "_",
simplify = T
)
fitted_cosinors %>%
write_csv("fitted_cosinors.csv")
This gives me the error:
`x` must not contain list or matrix columns:
✖ invalid columns at index(s): 16 17 18 19
In the environment pane the column has a data type of num [1:1615(1d)]
.
I suppose the columns are still somehow 1 dimensional.
How to get rid of this? The unnest
function call should have used the default option for simplify = T
which should have converted 1d list vectors into atomic vectors.
I explicitely added the simplify option