查看内置R包的来源[复制](View the source of an builtin R package [duplicate])

系统教程 行业动态 更新时间:2024-06-14 16:57:40
查看内置R包的来源[复制](View the source of an builtin R package [duplicate])

可能重复: 查看R包的来源

我想查看stats :: reorder的源代码。

这个答案似乎不适用于编译为字节码的内置包:

> stats::reorder function (x, ...) UseMethod("reorder") >bytecode: 0x103321718< >environment: namespace:stats<

Possible Duplicate: View the source of an R package

I want to see the source code of stats::reorder.

This answer seems not apply to built in packages which are compiled to bytecode:

> stats::reorder function (x, ...) UseMethod("reorder") >bytecode: 0x103321718< >environment: namespace:stats<

最满意答案

这与编译为字节码的重新排序无关,以及与它作为通用函数有关的所有内容。

我在这里的回答详细阐述了这一点。

但是,如果您想查看可以使用的代码,则需要专门针对这种情况

# Find what methods are available for reorder
methods(reorder)
# Attempt to check out the code for reorder.default
reorder.default
# Use getAnywhere to view code regardless of if it is exported
getAnywhere(reorder.default)

This has nothing to do with reorder being compiled to bytecode and everything to do with it being a generic function.

My answer here elaborates on this.

But specifically for this situation if you want to see the code you can use

# Find what methods are available for reorder
methods(reorder)
# Attempt to check out the code for reorder.default
reorder.default
# Use getAnywhere to view code regardless of if it is exported
getAnywhere(reorder.default)

                    
                     
          

更多推荐

本文发布于:2023-04-13 12:12:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/2943516f4807ba4f520b63e269b9cd04.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:来源   View   source   duplicate   package

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!