I am using Biblioshiny for Bibliometric analysis. As I am quite new to R, and would like to learn more about the underlaying code used by biblioshiny; I was wondering if it is possible to see the resulting R-code generated through the options configured in the web interface in biblishiny. E.g. when creating a ci-citation network in Biblioshiny, can I see the actual executed R-code used to generate this network?
Recently. I though perhaps one can enable a debug-mode and/or see the code through some logs. I do not know if this is the case, or if better solutions exists.
Related
I have a set of small, single(-ish)-function, R scripts that I use to build pipelines. The idea behind writing all these scripts is the possibility of reusing them in multiple pipelines. To do so, I would like to build a documentation to collect information about them into a single resource.
Roxygen is useful to document functions and create R packages with a complete documentation.
I am looking for the equivalent of Roxygen, but to document whole scripts. My ideal tool would be one where:
I can write a summary of usage, parameters and outputs for each R script
I can obtain an html page with a search bar to look up scripts based on keywords
Can be linked to a github repo and get automatically updated upon sending a new commit
Is there something like this around?
Thank you.
Coming from an R background, and just started learning Julia, I wonder how's documentation in Julia, and if there are analogues to R's help pages and vignettes.
Furthermore, in R, one can document functions using roxygen comment blocks, is there also something similar in Julia?
I think it is best to understand how things work by example. I will comment on how DataFrames.jl is documented as this is a pretty standard approach:
Functions are documented using docstrings, here is an example of a docstring of function names; These docstrings are then discoverable interactively via help system (by pressing ?)
A standard way to generate a documentation for a package is to use Documenter.jl; by the way: the package has a great team of maintainers who are very helpful and responsive; here you have a link to the make.jl file that is executed to generate the documentation; note in particular the option doctest=true which makes sure that all code examples that are properly anoteted following Documenter.jl rules are producing an expected output
In order to set-up auto-generation of package documentation you need to set up CI integration on GitHub; again - there are many ways to do it; a standard one is to use GitHub Actions; here you have a link to the part of the ci.yml specification file that ensures that documentation is built as a part of CI; then in any PR, e.g. this one (I am giving a link to a currently open PR that is documentation related) you can see in the section reporting CI results that after running tests also documentation was generated. Here you can see how a documentation generated using this toolchain looks like (e.g. note that at the bottom you can switch the version of the package you want to read manual of dynamically which shows you that all here is really well integrated - not just a bunch of PDF or HTML files).
I hope this will help you to get started. I have pointed you to all essential pieces that are normally used by packages hosted on GitHub (i.e. this is not the only way to do it, but it is a standard way most commonly used).
To master all the details of the above you need to read the documentation in the Julia Manual and Documenter.jl carefully. Unfortunately writing a proper documentation is not easy (in any programming language). The good thing is that Julia has a really excellent toolchain that supports this process very well.
I ask for any advice how to do documentaion / auto-documentation for larger shiny applications.
R packages have roxygen2, but are there any equivalents of auto-documentation for shiny server and ui code?
I'm working on a developing project of +15k lines of code and we push as much as possible to packages with roxygen2 docs, however all of the observes and reacts in central server script and its subscripts are not auto-documented. I also use git of course.
I have tried to tag every observe, reactive, module etc in source code with a unique ID and draw a diagram manually with corresponding IDs. The diagram describe what type of sub-element and topic. Later I would add all triggers etc. This process is very manual though. Maybe I could use "the reactive log" https://shiny.rstudio.com/articles/debugging.html to autogenerate such documentation?
...update 1: I have tried ShinyTester which reads through source code and try to predict a network of sub-element interactions. It did not handle sourcing of external files, but with a little debug I manage to get the below diagram. Unfortunately, only 5% of elements and interactions were discovered hereby. Maybe ShinyTester could need some contributions. :
I am developing a simple R package in which I would like to specify some local configuration options on package install. In particular, I would like the user to input a location on their computer on which to store package output data.
The package is most basically a random number generator. When used, it will generate a new random number, check the user-specified data file to make sure that number has not been generated, then either generate a new number, or append the new number to the data file.
I believe I could come up with a way to do this, but I'm wondering if there is a formal way of specifying something like configuration options that are particular to the local installation.
I've scoured the internet for information about this but not found much. This page may be somewhat related but in the end I didn't think this was exactly what I would want.
Thank you for any advice you can give!
I'm getting quite good at generating one off reports using R / Sweave / Knitr to process a template with R code that gets database data and produces a pdf / html / text / md or odf file, and I'm providing them more and more to users.
Ideally I'd love to provide an easy way for users to request a particular template with particular settings, then pick up the results of that report.
Can anyone suggest something like this, web based or whatever that will support an R / sweave workflow ??
Edit: Generating these reports (sweave'ing or knit'ting) can take a while, 3-5 mins, so support for requesting and later pickup is a must. In addtion multi user support would be good (i.e Bob can't see Jane's reports)
If you want a true, interactive, web-based R framework, I'd strongly recommend taking a look at RStudio's new app: Shiny.
If you actually just want static reports of the PDF/HTML variety, I don't know that you need much to get that off the ground. You're basically just looking to take form-based input from a web page, pass that to R, run your reports, and offer the file as a download.
To build a simple HTML form, PHP would be dead-simple and supported by most hosting providers.
Then use something like PHP's system() function to call your RScript code passing the parameters in that call.
In R, use the commandArgs() function to extract the parameters specified to your script, generate the report.
Offer the generated report to the web user.
If you wanted something more comprehensive, you can look at setting up RApache or a similar technology, but I really think with the amount of effort you'd expend setting that up, you (and your users) would probably be better off using Shiny and getting the benefits of interactivity.