File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -27,14 +27,16 @@ lookup <- function(FUN, ReturnType = character()) {
2727 if (is.function(FUN )) FUN <- deparse(substitute(FUN ))
2828 if (! is.character(FUN )) stop(" 'FUN' must be a character string for a function" )
2929 if (length(FUN ) != 1 ) stop(" 'FUN' must be of length one" )
30-
30+
3131 if (FUN == " nrow" ) FUN <- " NROW"
3232 if (FUN == " ncol" ) FUN <- " NCOL"
33+
34+ keep_cols <- colnames(rosetta ) != " RFunction"
3335 if (exists(FUN )) {
3436 matches <- as.logical(charmatch(rosetta $ RFunction , FUN , nomatch = 0L ))
35- if (any(matches )) return (rosetta [matches ,- 1 , drop = FALSE ])
37+ if (any(matches )) return (rosetta [matches , keep_cols , drop = FALSE ])
3638 }
3739 matches <- grepl(FUN , rosetta $ StanFunction , ignore.case = TRUE )
38- if (any(matches )) return (rosetta [matches ,- 1 , drop = FALSE ])
40+ if (any(matches )) return (rosetta [matches , keep_cols , drop = FALSE ])
3941 else return (" no matching Stan functions" )
4042}
You can’t perform that action at this time.
0 commit comments