如何将cson文件读入R
我遇到了一个cson(CoffeeScript对象表示法)文件格式,我想将其导入到R如何将cson文件读入R,r,string,parsing,cson,R,String,Parsing,Cson,我遇到了一个cson(CoffeeScript对象表示法)文件格式,我想将其导入到R cson_example <- "# Comments!!! # An Array with no commas! greatDocumentaries: [ 'earthlings.com' 'forksoverknives.com' 'cowspiracy.com' ] # An Object without braces! importantFacts: # Multi-Line Strings
cson_example <- "# Comments!!!
# An Array with no commas!
greatDocumentaries: [
'earthlings.com'
'forksoverknives.com'
'cowspiracy.com'
]
# An Object without braces!
importantFacts:
# Multi-Line Strings! Without Quote Escaping!
emissions: '''
Livestock and their byproducts account for at least 32,000 million tons of carbon dioxide (CO2) per year, or 51% of all worldwide greenhouse gas emissions.
Goodland, R Anhang, J. “Livestock and Climate Change: What if the key actors in climate change were pigs, chickens and cows?”
WorldWatch, November/December 2009. Worldwatch Institute, Washington, DC, USA. Pp. 10–19.
http://www.worldwatch.org/node/6294
'''
milk: '''
1,000 gallons of water are required to produce 1 gallon of milk.
“Water trivia facts.” United States Environmental Protection Agency.
http://water.epa.gov/learn/kids/drinkingwater/water_trivia_facts.cfm#_edn11
'''
more: 'http://cowspiracy.com/facts'"
cson\u示例您期望的R对象是什么?为什么不使用cson2json
转换为JSON,然后使用R中的一个JSON包读取它?