gpt4 book ai didi

r - 在 TO 覆盖一个函数中,我如何取回它?

转载 作者:行者123 更新时间:2023-12-03 18:16:26 28 4
gpt4 key购买 nike

我在 R session 中做了一些愚蠢的事情。我写

print = FALSE



现在我不能打印东西了!

print [1] FALSE



我如何取回它?

最佳答案

rm不会删除基础对象,因此您可以运行:

rm(print)

有趣的是,您可以打印以下内容:
> print <- FALSE
> print
[1] FALSE
> print("hi")
[1] "hi"
> rm(print)
> print("hi")
[1] "hi"
> print
function (x, ...)
UseMethod("print")
<bytecode: 0x2a3a148>
<environment: namespace:base>

关于r - 在 TO 覆盖一个函数中,我如何取回它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11084008/

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