Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将cson文件读入R_R_String_Parsing_Cson - Fatal编程技术网

如何将cson文件读入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(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! 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包读取它?