gpt4 book ai didi

r - R中的 `=`和 `<-`有什么区别?

转载 作者:行者123 更新时间:2023-12-03 04:46:04 25 4
gpt4 key购买 nike

我正在使用 R 2.8.1,并且可以同时使用 =<-作为变量赋值运算符。他们之间有什么区别?我应该使用哪一个?

最佳答案

来自here :

The operators <- and = assign into the environment in which they are evaluated. The operator <- can be used anywhere, whereas the operator = is only allowed at the top level (e.g., in the complete expression typed at the command prompt) or as one of the subexpressions in a braced list of expressions.

关于r - R中的 `=`和 `<-`有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2271575/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com