R中的函数别名

时间:2018-02-05 15:15:24

标签: r alias

我正在尝试为R中的函数创建别名。

例如,要获得R中矢量的长度:

length(the_vector)
#returns the length of the vector

我想创建一个名为“len”的函数的别名:

len(the_vector)
#will also return the length of the vector

有办法做到这一点吗?我想要的关键点是我希望别名能够采用原始函数可以采用的所有参数,并且别名不会替换原始函数。 (即在上面的示例中,调用length(the_vector)len(the_vector)会提供相同的结果吗?

0 个答案:

没有答案
相关问题