将帮助输出保存到文本文件

时间:2012-12-26 01:51:16

标签: r

如何将帮助输出文件保存到txt文件中?

write(help(reshape),file="/home/debian/test")

不起作用。

1 个答案:

答案 0 :(得分:4)

utils:::print.help_files_with_topic

的内脏中挖掘出来并进行改编
file <- help("reshape")
pkgname <- basename(dirname(dirname(file)))
temp <- tools::Rd2txt(utils:::.getHelpFile(file), out = tempfile("Rtxt"), 
                  package = pkgname)
file.copy(temp,"~/test.txt")