Skip to content

Commit 505155f

Browse files
committed
Convert manual to markdown
1 parent 5ecea67 commit 505155f

File tree

5 files changed

+46
-46
lines changed

5 files changed

+46
-46
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ VignetteBuilder: knitr
2121
License: GPL-2
2222
Encoding: UTF-8
2323
LazyData: true
24-
RoxygenNote: 6.1.1
24+
RoxygenNote: 7.1.1
25+
Roxygen: list(markdown = TRUE)

R/numerate.R

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
#' Auxiliary functions for working with lists
22
#'
3-
#' \itemize{
4-
#' \item{numerate}{ returns list of lists. Each list consists of two elements:
3+
#' - `numerate` returns list of lists. Each list consists of two elements:
54
#' sequential number of element and element. Reverse operation -
6-
#' \code{unumerate}.}
7-
#' \item{mark}{ returns list of lists. Each list consists of two elements: name of element and element. Reverse operation -
8-
#' \code{unmark}.}
9-
#' \item{zip_lists}{ combine lists side-by-sidy. Reverse operation - \code{unzip_list}.}
10-
#' \item{unzip_list}{ It's similair to matrix transposition but for list of lists.}
11-
#' \item{lag_list}{ convert argument to list of arguments with previous values. x -> list(x[i-1], x[i]).}
12-
#' }
5+
#' `unumerate`.
6+
#' - `mark` returns list of lists. Each list consists of two elements: name of element and element. Reverse operation -
7+
#' `unmark`.
8+
#' - `zip_lists` combines lists side-by-sidy. Reverse operation - `unzip_list`.
9+
#' - `unzip_list` is similair to matrix transposition but for list of lists.
10+
#' - `lag_list` converts argument to list of arguments with previous values: `x` -> `list(x[i-1], x[i])`.
1311
#'
1412
#' @param x list, vector or list of lists
1513
#' @param item numeric number of list in which stored values

R/to_list.R

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
#' List comprehensions for R
22
#'
3-
#' \itemize{\item{\code{to_list}}{ converts usual R loops expressions to list producers.
4-
#' Expression should be started with \code{for} , \code{while} or
5-
#' \code{repeat}. You can iterate over multiple lists if you provide several
6-
#' loop variables in backticks. See examples.}
7-
#' \item{\code{to_vec}}{ is the same as 'to_list' but return vector. See examples.}
8-
#' \item{\code{alter}}{ return the same type as its argument but with modified
3+
#' - `to_list` converts usual R loops expressions to list producers.
4+
#' Expression should be started with `for`, `while` or
5+
#' `repeat`. You can iterate over multiple lists if you provide several
6+
#' loop variables in backticks. See examples.
7+
#' - `to_vec` is the same as 'to_list' but return vector. See examples.
8+
#' - `alter` returns the same type as its argument but with modified
99
#' elements. It is useful for altering existing data.frames or lists. See
10-
#' examples.}
11-
#' \item{\code{exclude}}{ is an auxiliary function for dropping elements in
12-
#' 'alter'. There are no arguments for this function.}
13-
#' }
14-
#' @param expr expression which starts with \code{for} , \code{while} or \code{repeat}.
15-
#' @param recursive logical. Should unlisting be applied to list components of result? See \link[base]{unlist} for details.
16-
#' @param use.names logical. Should names be preserved? See \link[base]{unlist} for details.
10+
#' examples.
11+
#' - `exclude` is an auxiliary function for dropping elements in
12+
#' `alter`. There are no arguments for this function.
13+
#'
14+
#' @param expr expression which starts with `for`, `while` or `repeat`.
15+
#' @param recursive logical. Should unlisting be applied to list components of result? See [unlist][base::unlist] for details.
16+
#' @param use.names logical. Should names be preserved? See [unlist][base::unlist] for details.
1717
#' @param data data.frame/list/vector which we want to alter
18-
#' @return list for \code{to_list} and vector for \code{to_vec}
18+
#' @return list for `to_list` and vector for `to_vec`
1919
#' @export
2020
#'
2121
#' @examples
@@ -141,20 +141,20 @@ add_expansion_to_loop = function(expr){
141141
}
142142

143143
is_loop = function(expr){
144-
if(!is.call(expr)) return(FALSE)
144+
is.call(expr) || return(FALSE)
145145
first_item = expr[[1]]
146146
identical(first_item, quote(`for`)) ||identical(first_item, quote(`while`)) ||identical(first_item, quote(`repeat`))
147147
}
148148

149149
is_for_loop = function(expr){
150-
if(!is.call(expr)) return(FALSE)
150+
is.call(expr) || return(FALSE)
151151
first_item = expr[[1]]
152152
identical(first_item, quote(`for`))
153153
}
154154

155155
has_loop_inside = function(expr){
156-
if(!is.call(expr)) return(FALSE)
157-
if(is_loop(expr)) return(TRUE)
156+
is.call(expr) || return(FALSE)
157+
!is_loop(expr) || return(TRUE)
158158
any(
159159
unlist(
160160
lapply(as.list(expr), has_loop_inside),

man/numerate.Rd

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/to_list.Rd

Lines changed: 12 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)