Show an Rd file in viewer from Rstudio

前端 未结 1 2010
清歌不尽
清歌不尽 2021-01-25 15:44

I have documentation for functions and datasets in a project folder. In a documentation folder, I have .Rd files for all the datasets. I\'d like the user to be able to call a cu

相关标签:
1条回答
  • 2021-01-25 16:07

    I don't quite understand why you want to do this, but it's possible. What you should do is just put your datasets into a package, document them there, and then users get easy access to them.

    But if you really want to avoid that for some reason, here's how:

    library(magrittr)
    library(htmltools)
    library(tools)
    f <- "some.Rd"   # Set a filename for an Rd file here
    f %>% 
      parse_Rd %>% 
      (function(x) capture.output(Rd2HTML(x))) %>% 
      HTML %>% 
      browsable
    
    0 讨论(0)
提交回复
热议问题