Skip to content

Commit

Permalink
doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mschubert committed Jan 28, 2018
1 parent 2e57f74 commit fa54f56
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
6 changes: 3 additions & 3 deletions R/flatten.r
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#' Flattens an array along an axis
#'
#' @param X Array
#' @param x Array
#' @param along Along which axis to bind them together (default: last)
#' @param name_sep Which character to use for naming new arrays [default: NA, do not touch names]
#' @return An array with n-1 dimensions
#' @export
flatten = function(X, along=-1, name_sep=NA) {
flatten = function(x, along=-1, name_sep=NA) {
if (along == -1)
along = length(dim(x))

re = split(X, along=along, drop=TRUE)
re = split(x, along=along, drop=TRUE)

if (!is.na(name_sep))
re = mapply(function(x, n) {
Expand Down
3 changes: 3 additions & 0 deletions R/util.r
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ guess_structure = function(df, verbose=TRUE) {
}

#' Return a list of named dot-arguments
#'
#' @param ... Function arguments
#' @return Named function arguments
named_dots = function(...) {
dots = eval(substitute(alist(...)))
dnames = names(dots) %or% rep("", length(dots))
Expand Down
4 changes: 2 additions & 2 deletions man/flatten.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions man/named_dots.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fa54f56

Please sign in to comment.