$f,g\colon\mathbb{R}\longrightarrow\mathbb{R}$, it is natural to define $f+g$ as the function that maps $x\in\mathbb{R}$ to $f(x) + g(x)$. However, in base R, objects of class function do not have arithmetic methods defined, so idiom such as "f + g" returns an error, even though it has a perfectly reasonable expectation. The vfunc package offers this functionality. Other similar features are provided, which lead to compact and readable idiom. A wide class of coding bugs is eliminated.


翻译:对于函数 $f,g\colon\mathbb{R}\longrightarrow\mathbb{R}$,自然可以定义 $f+g$ 为将 $x\in\mathbb{R}$ 映射到 $f(x) + g(x)$ 的函数。然而,在基础R语言中,函数类对象未定义算术运算方法,因此诸如"f + g"这样的表达式会返回错误,尽管其具有完全合理的预期。vfunc包提供了这一功能。该包还提供了其他类似特性,使得代码表达更加简洁易读。同时,它也消除了大量编码错误。

0
下载
关闭预览

相关内容

专知会员服务
92+阅读 · 2021年4月12日
Python编程基础,121页ppt
专知会员服务
49+阅读 · 2021年1月1日
【视频】几何数据嵌入表示学习,74页ppt
专知会员服务
35+阅读 · 2020年7月24日
一份简明有趣的Python学习教程,42页pdf
专知会员服务
78+阅读 · 2020年6月22日
Python计算导论,560页pdf,Introduction to Computing Using Python
专知会员服务
77+阅读 · 2020年5月5日
【反馈循环自编码器】FEEDBACK RECURRENT AUTOENCODER
专知会员服务
23+阅读 · 2020年1月28日
百闻不如一码!手把手教你用Python搭一个Transformer
大数据文摘
18+阅读 · 2019年4月22日
AmpliGraph:知识图谱表示学习工具包
专知
40+阅读 · 2019年4月6日
R工程化—Rest API 之plumber包
R语言中文社区
11+阅读 · 2018年12月25日
基于R语言进行Box-Cox变换
R语言中文社区
45+阅读 · 2018年11月19日
【收藏】支持向量机原理详解+案例+代码!【点击阅读原文下载】
机器学习算法与Python学习
10+阅读 · 2018年9月13日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 6月8日
Arxiv
0+阅读 · 5月24日
Arxiv
17+阅读 · 2022年1月11日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
7+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
8+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
6+阅读 · 6月17日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员