|
5 | 5 | #' can be used. |
6 | 6 | #' |
7 | 7 | #' @param state state to start from |
8 | | -#' @param name name of the function/operator as a string, e.g. \code{"mean"}, |
9 | | -#' \code{"+"} or \code{"..."}; can also be used for positional access, e.g. |
10 | | -#' \code{1} for the first argument and \code{"..1"} for the first item in |
11 | | -#' \code{"..."} |
| 8 | +#' @param name name of the function/operator as a string, e.g. \code{"mean"} or |
| 9 | +#' \code{"+"} |
12 | 10 | #' @param index integer that specifies which call of \code{name} in the |
13 | 11 | #' solution code will be checked. |
14 | 12 | #' @param eval logical vector indicating whether and how to compare arguments. |
|
37 | 35 | #' @param arg_not_specified_msg custom message in case argument was not |
38 | 36 | #' specified (for \code{check_arg}) |
39 | 37 | #' @param arg name or position of argument to specify |
40 | | -#' ... Arguments can be accessed using '..<INDEX>' (see example 4) (for \code{check_arg}) |
| 38 | +#' ... Arguments can be accessed using '..<INDEX>' (see example 5) (for \code{check_arg}) |
41 | 39 | #' |
42 | 40 | #' @examples |
43 | 41 | #' \dontrun{ |
|
62 | 60 | #' # SCT |
63 | 61 | #' ex() %>% check_operator("+") %>% check_result() %>% check_equal() |
64 | 62 | #' } |
| 63 | +#' |
| 64 | +#' # Example 4: Positional argument check |
| 65 | +#' cor(rnorm(10), rnorm(10)) |
| 66 | +#' |
| 67 | +#' # SCT |
| 68 | +#' ex() %>% check_function("cor") %>% { |
| 69 | +#' check_arg(., 1) %>% check_equal() |
| 70 | +#' check_arg(., 2) %>% check_equal() |
| 71 | +#' } |
65 | 72 | #' |
66 | | -#' # Example 4: ... in check_args |
| 73 | +#' # Example 5: ... in check_args |
67 | 74 | #' |
68 | 75 | #'soln <- "std_dev <- purrr::compose(sqrt, var, .dir='forward')" |
69 | 76 | #'state <- setup_state(soln, soln) |
|
0 commit comments