vertesy / roxygenready Goto Github PK
View Code? Open in Web Editor NEWPrepare your R function library to be compiled into an R package by Roxygen
Home Page: http://vertesy.github.io/RoxygenReady
License: GNU General Public License v3.0
Prepare your R function library to be compiled into an R package by Roxygen
Home Page: http://vertesy.github.io/RoxygenReady
License: GNU General Public License v3.0
fct(dir = "/path/to/file", ...)
becomes
#' @examples fct(dir = /path/to/file, ...)
Although I know it's not the coding standard, I use =
for assignment in R, and this includes function defintion. I see that rr_extract_all_functions_from_a_script is grepping as follows:
patt = " *<- *function *\\(.+"
index = grep(patt, ScriptAsStringsPerLine, perl = T)
This results in RoxygenReady not detecting any functions in my script.
instead of
#' RoxygenReady.MemoryToClipboard
it should be:
#' Your functions
Neither in RoxygenReady(), nor in rr_ ... overview function..
subl /Users/abelvertesy/roxygenready.github.io/index.html
Refer to RStudio's single function feature
Also refer to
https://cran.r-project.org/web/packages/roxygen2/vignettes/rd.html
& Learn about package testing...
This is a useful premise for a package. Running on a sample script I find:
Error in rr_extract_default_args(funnames[i]) :
could not find function "as.named.vector"
Looking in another repo I see: https://github.com/vertesy/TheCorvinas/blob/master/R/CodeAndRoll.R#L186
as.named.vector <- function(df_col, WhichDimNames = 1) { # Convert a dataframe column or row into a vector, keeping the corresponding dimension name.
# use RowNames: WhichDimNames = 1 , 2: use ColNames
# !!! might require drop=F in subsetting!!! eg: df_col[,3, drop=F]
# df_col[which(unlist(lapply(df_col, is.null)))] = "NULL" # replace NULLs - they would fall out of vectors - DOES not work yet
namez = dimnames(df_col)[[WhichDimNames]]
if (is.list(df_col) & !is.data.frame(df_col)) {namez = names(df_col)}
vecc = as.vector(unlist (df_col))
names (vecc)= namez
return (vecc)
}
Sourcing the above function allows the code to run without error.
Constantly getting Error in FUN(X[[i]], ...) : object ' FUN' not found in almost all files.
in rr_extract_all_functions_from_a_script the regex needs to be:
patt = " *(<-|=) *function *\\(.+"
instead of:
patt = " *<-|= *function *\\(.+"
or you will grep other (non-function) lines.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.