Unimplemented type list when trying to write.table

前端 未结 6 2137
说谎
说谎 2020-12-08 06:45

I have the following data.table (data.frame) called output:

> head(output)
        Id                                           Title IsProhibited
1 10000         


        
6条回答
  •  醉酒成梦
    2020-12-08 07:20

    Another easy solution. Maybe one or more columns are of type list, so we need convert them to "character" or data frame. So there are two easy solutions

    1. Convert each column "as.character" using--

      df$col1 = as.character(df$col1)

      df$col2 = as.character(df$col2)

      .......and so on

    2. The best one convert df in to a "matrix"

      df = as.matrix(df)

    now write df into csv. Works for me.

提交回复
热议问题