如何测试两个函数变量指向同一个函数?
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
答案 0 :(得分:7)
尝试:
identical(test, lm)
identical(test, test2)