0

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

user438383
  • 5,716
  • 8
  • 28
  • 43
Darius
  • 11
  • 2
  • 3
    please provide sample data, see https://stackoverflow.com/q/5963269 , [mcve], and https://stackoverflow.com/tags/r/info for discussions on `dput`, `data.frame`, and `read.table`. – r2evans May 12 '23 at 14:48

0 Answers0