Dasonk / docstring

Provides docstring like functionality to R functions without requiring the need to create a package.
57 stars 6 forks source link

making compatible with sos. #18

Closed nfultz closed 5 years ago

nfultz commented 7 years ago

Here's an example session:

> library(sos)
> library(docstring)
> ???bayesfactor
found 80 matches;  retrieving 4 pages
2 3 4 
Downloaded 80 links in 10 packages.
> square <- function(x){
+ 
+     #' Square a number
+     #'
+     #' Calculates the square of the input
+     #'
+     #' @param x the input to be squared
+ 
+     return(x^2)
+ }
> 
> ?square
> ?cat
Dasonk commented 7 years ago

Interesting. It's failing the travis builds in the check phase though. It's giving:

checking whether the package can be loaded with stated dependencies ... WARNING
Error : .onAttach failed in attachNamespace() for 'docstring', details:
  call: get("?", parent.env(parent.env(.GlobalEnv)))
  error: object '?' not found
Error: package or namespace load failed for ‘docstring’
Execution halted

https://travis-ci.org/Dasonk/docstring/jobs/223288517

nfultz commented 7 years ago

Fixed by changing get to get0.

Dasonk commented 7 years ago

I've been quite busy lately and haven't had much time to play around with this. I'll give it some attention hopefully in the next week or so.