使用R分析资产负债表和损益表 [英] Using R to Analyze Balance Sheets and Income Statements

查看:125
本文介绍了使用R分析资产负债表和损益表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对使用R分析资产负债表和损益表很感兴趣.我已经看到有一些R软件包可以从Yahoo和Google Finance获取信息,但是我看到的所有示例都涉及历史股价信息.有没有办法使用R从资产负债表和损益表中提取历史信息?

解决方案

您正在犯一个常见的错误,就是将对Yahoo或Google数据的访问权"与我在Yahoo或Google财经上看到的所有内容都可以下载"相混淆. >

当R函数下载历史股票价格数据时,它们几乎总是访问为此目的明确设计的接口.一个cgi处理程序,提供给定了股票代码以及开始和结束日期的csv文件.因此,我们要做的这 easy 就是形成适当的查询,点击网络服务器,然后将csv文件提取并稀疏处理.

据我所知,现在资产负债表信息在这样的界面中不可用.因此,您将需要屏幕抓取"并直接解析html.

目前尚不清楚R是否是最佳工具.我知道一些Perl模块是为了从Yahoo Finance中获取非时间序列数据,但并未使用它们.

I am interested in analyzing balance sheets and income statements using R. I have seen that there are R packages that pull information from Yahoo and Google Finance, but all the examples I have seen concern historical stock price information. Is there a way I can pull historical information from balance sheets and income statements using R?

解决方案

You are making the common mistake of confusing 'access to Yahoo or Google data' with 'everything I see on Yahoo or Google Finance can be downloaded'.

When R functions download historical stock price data, they almost always access an interface explicitly designed for this purpose as e.g. a cgi handler providing csv files given a stock symbol and start and end date. So this easy as all we need to do is form the appropriate query, hit the webserver, fetch the csv file an dparse it.

Now balance sheet information is (as far as I know) not available in such an interface. So you will need to 'screen scrape' and parse the html directly.

It is not clear that R is the best tool for this. I am aware of some Perl modules for the purpose of getting non-time-series data off Yahoo Finance but have not used them.

这篇关于使用R分析资产负债表和损益表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆