Convert .Rd file to plain text

I am trying to convert R documentation files (extension .Rd) to plain text. I know that RdUtils contains a tool called Rdconv , but as far as I know, it can only be used from the command line. Is there a way to access Rdconv (or a similar conversion tool) from an R session?

+6
source share
2 answers

Try

tools::Rd2txt("path/to/file.Rd") 
+7
source

You can always invoke a system command, for example. with system2 function:

 input <- '~/Projekty/stringi/man/stri_length.Rd' output <- '/tmp/out.txt' system2('R', paste('CMD Rdconv -t txt', filename, '-o', output)) readLines(output) ## [1] "Count the Number of Characters" ## ... 

Make sure R is in the system search path. If not, replace the first argument to system2() above with the full path, for example. C:\Program Files\R\3.1\bin\R.exe .

+2
source

Source: https://habr.com/ru/post/969926/


All Articles