测试两个函数变量指向同一个函数?

时间:2011-09-30 01:21:43

标签: r

如何测试两个函数变量指向同一个函数?

test = lm
test2 = lm

test == lm     # error: comparison (1) is possible only for atomic and list types
test == test2  # error: comparison (1) is possible only for atomic and list types

1 个答案:

答案 0 :(得分:7)

尝试:

identical(test, lm)
identical(test, test2)