Export a list into a CSV or TXT file in R

后端 未结 8 2026
遥遥无期
遥遥无期 2020-11-27 16:02

I\'m sorry to ask this question. I\'m very noob with R. I know there is a lot of threads which are related to the very same problem. I understood that we cannot export a tab

8条回答
  •  没有蜡笔的小新
    2020-11-27 16:14

    I export lists into YAML format with CPAN YAML package.

    l <- list(a="1", b=1, c=list(a="1", b=1))
    yaml::write_yaml(l, "list.yaml")
    

    Bonus of YAML that it's a human readable text format so it's easy to read/share/import/etc

    $ cat list.yaml
    a: '1'
    b: 1.0
    c:
      a: '1'
      b: 1.0
    

提交回复
热议问题