Is it possible to write a table to a file in JSON format in R?

前端 未结 3 1330
滥情空心
滥情空心 2021-02-13 16:35

I\'m making word frequency tables with R and the preferred output format would be a JSON file. sth like { \"word\" : \"dog\", \"frequency\" : 12 } Is there any

3条回答
  •  庸人自扰
    2021-02-13 16:58

    RJSONIO is a package "that allows conversion to and from data in Javascript object notation (JSON) format". You can use it to export your object as a JSON file.

    library(RJSONIO)    
    writeLines(toJSON(anobject), "afile.JSON")
    

提交回复
热议问题