Unimplemented type list when trying to write.table

前端 未结 6 2139
说谎
说谎 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:24

    Assuming

    • the path you want to save to is Path, i.e. path=Path

    • df is the dataframe you want to save,

    follow those steps:

    1. Save df as txt document:

      write.table(df,"Path/df.txt",sep="|")
      
    2. Read the text file into R:

      Data = read.table("Path/df.txt",sep="|")
      
    3. Now save as csv:

      write.csv(Data, "Path/df.csv")
      

    That's it.

提交回复
热议问题