我已经下载了R-3.0.2.tar
的源tar文件(不是二进制R文件),当我解压缩时,/R-3.0.2/src/library/stats/R/
中有一个名为loess.R的文件。
当我编译并安装R时,我在安装的目录中找不到它。当我输入
getAnywhere(loess)
输出信息末尾<bytecode: 0x02d9a104>
的含义是什么?
为什么我能看到黄土和黄土的源代码.R同时消失了?
事实上,loess.R被编译成二进制形式
1.将哪个二进制文件loess.R编译成?
2.如果我有包含loess.R的二进制文件,我尝试将其反编译为loess.R的源代码,以便在我的计算机知识中取得进步。可能现在R中有一个反编译代码,当输入getAnywhere( loess),代码被称为总是为它的主人工作。
bytecode: 0x02d9a104
是编译文件中包含loess.R?
list.files("C:/Program Files/R/R-3.0.2", full.names=TRUE,recursive = TRUE )->x
x[grep(pattern="stats",y)]
[1] "C:/Program Files/R/R-3.0.2/include/R_ext/stats_package.h" "C:/Program Files/R/R-3.0.2/include/R_ext/stats_stubs.h"
[3] "C:/Program Files/R/R-3.0.2/library/stats/COPYRIGHTS.modreg" "C:/Program Files/R/R-3.0.2/library/stats/demo/glm.vr.R"
[5] "C:/Program Files/R/R-3.0.2/library/stats/demo/lm.glm.R" "C:/Program Files/R/R-3.0.2/library/stats/demo/nlm.R"
[7] "C:/Program Files/R/R-3.0.2/library/stats/demo/smooth.R" "C:/Program Files/R/R-3.0.2/library/stats/DESCRIPTION"
[9] "C:/Program Files/R/R-3.0.2/library/stats/help/aliases.rds" "C:/Program Files/R/R-3.0.2/library/stats/help/AnIndex"
[11] "C:/Program Files/R/R-3.0.2/library/stats/help/paths.rds" "C:/Program Files/R/R-3.0.2/library/stats/help/stats.rdb"
[13] "C:/Program Files/R/R-3.0.2/library/stats/help/stats.rdx" "C:/Program Files/R/R-3.0.2/library/stats/html/00Index.html"
[15] "C:/Program Files/R/R-3.0.2/library/stats/html/R.css" "C:/Program Files/R/R-3.0.2/library/stats/INDEX"
[17] "C:/Program Files/R/R-3.0.2/library/stats/libs/i386/stats.dll" "C:/Program Files/R/R-3.0.2/library/stats/Meta/demo.rds"
[19] "C:/Program Files/R/R-3.0.2/library/stats/Meta/hsearch.rds" "C:/Program Files/R/R-3.0.2/library/stats/Meta/links.rds"
[21] "C:/Program Files/R/R-3.0.2/library/stats/Meta/nsInfo.rds" "C:/Program Files/R/R-3.0.2/library/stats/Meta/package.rds"
[23] "C:/Program Files/R/R-3.0.2/library/stats/Meta/Rd.rds" "C:/Program Files/R/R-3.0.2/library/stats/NAMESPACE"
[25] "C:/Program Files/R/R-3.0.2/library/stats/R/stats" "C:/Program Files/R/R-3.0.2/library/stats/R/stats.rdb"
[27] "C:/Program Files/R/R-3.0.2/library/stats/R/stats.rdx" "C:/Program Files/R/R-3.0.2/library/stats/SOURCES.ts"
[29] "C:/Program Files/R/R-3.0.2/library/stats/tests/cmdscale.R" "C:/Program Files/R/R-3.0.2/library/stats/tests/drop1-polr.R"
[31] "C:/Program Files/R/R-3.0.2/library/stats/tests/glm.R" "C:/Program Files/R/R-3.0.2/library/stats/tests/glm.Rout.save"
[33] "C:/Program Files/R/R-3.0.2/library/stats/tests/ig_glm.R" "C:/Program Files/R/R-3.0.2/library/stats/tests/ks-test.R"
[35] "C:/Program Files/R/R-3.0.2/library/stats/tests/ks-test.Rout.save" "C:/Program Files/R/R-3.0.2/library/stats/tests/nafns.R"
[37] "C:/Program Files/R/R-3.0.2/library/stats/tests/nls.R" "C:/Program Files/R/R-3.0.2/library/stats/tests/nls.Rout.save"
[39] "C:/Program Files/R/R-3.0.2/library/stats/tests/NLSstClosest.R" "C:/Program Files/R/R-3.0.2/library/stats/tests/offsets.R"
[41] "C:/Program Files/R/R-3.0.2/library/stats/tests/ppr.R" "C:/Program Files/R/R-3.0.2/library/stats/tests/ppr_test.csv"
[43] "C:/Program Files/R/R-3.0.2/library/stats/tests/simulate.R" "C:/Program Files/R/R-3.0.2/library/stats/tests/simulate.Rout.save"
[45] "C:/Program Files/R/R-3.0.2/library/stats/tests/smooth.spline.R" "C:/Program Files/R/R-3.0.2/library/stats/tests/ts-tests.R"
[47] "C:/Program Files/R/R-3.0.2/library/stats4/DESCRIPTION" "C:/Program Files/R/R-3.0.2/library/stats4/help/aliases.rds"
[49] "C:/Program Files/R/R-3.0.2/library/stats4/help/AnIndex" "C:/Program Files/R/R-3.0.2/library/stats4/help/paths.rds"
[51] "C:/Program Files/R/R-3.0.2/library/stats4/help/stats4.rdb" "C:/Program Files/R/R-3.0.2/library/stats4/help/stats4.rdx"
[53] "C:/Program Files/R/R-3.0.2/library/stats4/html/00Index.html" "C:/Program Files/R/R-3.0.2/library/stats4/html/R.css"
[55] "C:/Program Files/R/R-3.0.2/library/stats4/INDEX" "C:/Program Files/R/R-3.0.2/library/stats4/Meta/hsearch.rds"
[57] "C:/Program Files/R/R-3.0.2/library/stats4/Meta/links.rds" "C:/Program Files/R/R-3.0.2/library/stats4/Meta/nsInfo.rds"
[59] "C:/Program Files/R/R-3.0.2/library/stats4/Meta/package.rds" "C:/Program Files/R/R-3.0.2/library/stats4/Meta/Rd.rds"
[61] "C:/Program Files/R/R-3.0.2/library/stats4/NAMESPACE" "C:/Program Files/R/R-3.0.2/library/stats4/R/stats4"
[63] "C:/Program Files/R/R-3.0.2/library/stats4/R/stats4.rdb" "C:/Program Files/R/R-3.0.2/library/stats4/R/stats4.rdx"
[65] "C:/Program Files/R/R-3.0.2/library/stats4/tests/confint.R" "C:/Program Files/R/R-3.0.2/share/dictionaries/en_stats.rds"
[67] "C:/Program Files/R/R-3.0.2/share/dictionaries/en_stats.txt" "C:/Program Files/R/R-3.0.2/tests/Examples/stats-Ex.Rout.save"
[69] "C:/Program Files/R/R-3.0.2/tests/Examples/stats4-Ex.Rout.save"
答案 0 :(得分:0)
该文件位于$ R_HOME $设置的任何目录中。这就是我在我的机器上确定该位置的方式(如果我已经没有记住该位置):
> R.home(component = "home")
[1] "/Library/Frameworks/R.framework/Resources"
您将该值添加到/R-3.0.2/src/library/stats/R/
以获取计算机上loess.R的位置。如果你想看看我是怎么想出来的(实际上并不知道我头顶的细节),那么输入:
?Startup
...并按照该帮助页面上的链接进行操作。我的stats包实际上是在一个编译包中:/Library/Frameworks/R.framework/Versions/3.0/Resources/library/stats/R/stats
。 (我的安装中没有源代码。不是Unix精明的人。仍然使用已编译的二进制文件。)
答案 1 :(得分:0)
正如@DWin评论中所述,安装R后,loess.R
文件不再“存在”;所有这些R源文件的内容(字节编译和存储)更有效地存储,因此当被要求这样做时,R可以非常快速地加载这些对象[loess
,通常在启动时,{{1包装已加载并附加]。这完全类似于您在R源代码中找到的* .c和* .f C和Fortran源文件。这些都被编译(和链接)到对象库中,原始源文件就是它们:“在源代码中”; - )