首页    期刊浏览 2024年12月02日 星期一
登录注册

文章基本信息

  • 标题:Programmer’s Niche: Macros in R
  • 本地全文:下载
  • 作者:Thomas Lumley
  • 期刊名称:R News
  • 印刷版ISSN:1609-3631
  • 出版年度:2001
  • 卷号:1
  • 期号:3
  • 页码:11
  • 出版社:The R Foundation for Statistical Computing
  • 摘要:A familiar source of questions on the R mailing lists is the newly converted R user who is trying to write SAS or Stata code in R. Bill Venables then points out to them that R is not a macro language, and gently explains that there is a much easier solution to their problems. In this article I will explain what a macro is, why it’s good that R isn’t a macro language, and how to make it into one. There are two reasons for this. It has been famously observed1 that a Real Programmer can write Fortran code in any language, and it is similarly an interesting exercise to see how R can implement macros. Secondly, there are a few tasks for which macros are genuinely useful, which is why languages like LISP, for example, provide them.
国家哲学社会科学文献中心版权所有