{"title":"The R Language for Statistical Computing","authors":"M. Bennett, D. Hugen","doi":"10.1017/CBO9781316584460.003","DOIUrl":null,"url":null,"abstract":"Like so many innovations in computing, including the Unix operating system and the C and C++ languages, the R language has its roots at AT&T Bell Laboratories during the 1970s and 1980s in the S language project (Becker, Chambers, and Wilks, 1988). People think that the S language would not have been designed in the way it was if it had been designed by computer scientists (Morandat, Hill, Osvald, and Vitek, 2012). It was designed by statisticians in order to link together calls to FORTRAN packages, which were well known and trusted, and it flourished in the newly developed Unix and C environment. R is an open source variant of S developed at the University of Auckland by Ross Ihaka and Robert Gentleman, first appearing in 1993 (Ihaka, 1998). The chosen rules for scoping of variables and parameter passing make it hard for interpreter and compiler writers to make R run fast. In order to remedy this, packages such as Rcpp have been developed for R, allowing R programs to call pre-compiled C++ programs to optimize sections of the algorithms which are bottlenecks in terms of speed (Eddelbuettel and Sanderson, 2014). We discuss the Rcpp package toward the end of the book. Clearly the recent popularity of R, fueled by its open source availability and the need for statistical and analytical computing tools, shows that the benefits of R far outweigh the negatives. Overall, R is based upon the vector as a first class item in the language. R shares this attribute with LISP, Scheme, Python, and Matlab. This and the prevalence of over 4,000 publicly available packages are two of the many strengths of R. In this book, we will focus on R packages that revolve around financial analytics. It is our intention to introduce R at this point for those readers who need or are interested in a summary. Feel free to skip this chapter if you are experienced in R. For those who are not, many of the examples are worth trying out in an R environment to get a feel for the language. By including this section, this book is self-contained and we make no assumption that the reader arrives at this book having an R background.","PeriodicalId":0,"journal":{"name":"","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2016-10-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"82","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1017/CBO9781316584460.003","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 82
Abstract
Like so many innovations in computing, including the Unix operating system and the C and C++ languages, the R language has its roots at AT&T Bell Laboratories during the 1970s and 1980s in the S language project (Becker, Chambers, and Wilks, 1988). People think that the S language would not have been designed in the way it was if it had been designed by computer scientists (Morandat, Hill, Osvald, and Vitek, 2012). It was designed by statisticians in order to link together calls to FORTRAN packages, which were well known and trusted, and it flourished in the newly developed Unix and C environment. R is an open source variant of S developed at the University of Auckland by Ross Ihaka and Robert Gentleman, first appearing in 1993 (Ihaka, 1998). The chosen rules for scoping of variables and parameter passing make it hard for interpreter and compiler writers to make R run fast. In order to remedy this, packages such as Rcpp have been developed for R, allowing R programs to call pre-compiled C++ programs to optimize sections of the algorithms which are bottlenecks in terms of speed (Eddelbuettel and Sanderson, 2014). We discuss the Rcpp package toward the end of the book. Clearly the recent popularity of R, fueled by its open source availability and the need for statistical and analytical computing tools, shows that the benefits of R far outweigh the negatives. Overall, R is based upon the vector as a first class item in the language. R shares this attribute with LISP, Scheme, Python, and Matlab. This and the prevalence of over 4,000 publicly available packages are two of the many strengths of R. In this book, we will focus on R packages that revolve around financial analytics. It is our intention to introduce R at this point for those readers who need or are interested in a summary. Feel free to skip this chapter if you are experienced in R. For those who are not, many of the examples are worth trying out in an R environment to get a feel for the language. By including this section, this book is self-contained and we make no assumption that the reader arrives at this book having an R background.
像Unix操作系统、C和c++语言等许多计算领域的创新一样,R语言起源于20世纪70年代和80年代AT&T贝尔实验室的S语言项目(Becker, Chambers, and Wilks, 1988)。人们认为,如果S语言是由计算机科学家设计的,那么它就不会被设计成现在的样子(Morandat, Hill, Osvald, and Vitek, 2012)。它是由统计学家设计的,目的是将对FORTRAN包的调用连接在一起,FORTRAN包是众所周知和可信的,它在新开发的Unix和C环境中蓬勃发展。R是由奥克兰大学的Ross Ihaka和Robert Gentleman开发的S的开源变体,于1993年首次出现(Ihaka, 1998)。变量作用域和参数传递的选择规则使得解释器和编译器编写者很难让R运行得更快。为了解决这个问题,已经为R开发了Rcpp等包,允许R程序调用预编译的c++程序来优化算法的部分,这些部分在速度方面是瓶颈(Eddelbuettel和Sanderson, 2014)。我们将在本书的最后讨论Rcpp包。很明显,由于R的开源可用性以及对统计和分析计算工具的需求,R最近的流行表明R的优点远远大于缺点。总的来说,R基于向量作为语言中的第一类项。R与LISP、Scheme、Python和Matlab共享此属性。这一点和超过4000个公开可用包的流行是R的两个优势。在本书中,我们将重点关注围绕财务分析的R包。我们打算在这里为那些需要或对总结感兴趣的读者介绍R。如果你有R语言经验,可以跳过这一章。对于那些没有R语言经验的人,很多例子都值得在R环境中尝试一下,来感受一下这门语言。通过包含这一部分,本书是独立的,我们不假设读者在阅读本书时具有R背景。