0

I've got a dataFrame via spotify api which contains the data of a playlist. I want to write the song title and the artist to a csv. problem is the dataframe contains a column track.artists which is a dataFrame itself with just one row, which contains a column whith the artist name.

so this doesnt work:

playlist %>%
   select(track.name, track.artist) %>%
   write.csv(path, row.names=FALSE)

I get the error "Unimplemented type 'list' in EncoderElement"

camille
  • 16,432
  • 18
  • 38
  • 60
  • [See here](https://stackoverflow.com/q/5963269/5325862) on making a reproducible example that is easier for folks to help with. After including a representative sample of data, you should also add how exactly you want to deal with the nested data frame – camille Mar 07 '22 at 18:27

1 Answers1

1

Does this work for you?

playlist %>%
  select(track.name, track.artist) %>%
  unnest(track.artist) %>% 
  write.csv(path, row.names=FALSE)
langtang
  • 22,248
  • 1
  • 12
  • 27