r - 如何将 cson 文件读入 R
问题描述
我遇到了一个 cson(CoffeeScript-Object-Notation)文件格式,我想将它导入 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 文件导入 R 的可靠方法?
解决方案
推荐阅读
- javascript - 计数器应重置为零,然后再次从 1 开始
- javascript - 数组中的 findOneAndUpdate 嵌套对象
- python - Python 替代全局变量
- javascript - 有没有办法限制对 DRF 接口的访问,同时仍然能够访问 api-endpoints?
- android - 如何更改通过 Google Play 控制台为测试人员发送的信件的语言?
- angular - 通过 ActivatedRoute 或任何方式获取子组件的名称
- express - 快拆项目
- heroku - 在带有 Rails 5.2 的 Heroku 上,无法加载“Rails.config.active_storage.service”:(Aws::Sigv4::Errors::MissingCredentialsError)
- ionic-framework - iIonic 4 离子标签
- python - 将对象插入多处理管理器,dict