Skip to content

Commit

Permalink
Update doc ref #26
Browse files Browse the repository at this point in the history
Add \value
  • Loading branch information
chainsawriot committed May 10, 2024
1 parent 1c6bf84 commit 10a046d
Show file tree
Hide file tree
Showing 14 changed files with 52 additions and 36 deletions.
15 changes: 10 additions & 5 deletions R/parser.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ collector_find <- function(name) {
#' @param .return_problems Whether to hide the `problems` tibble from the output
#' @keywords internal
#' @export
#' @return a parsed vector
#' @examples
#' x <- c("1", "2", "3", "NA")
#' parse_vector(x, col_integer())
Expand Down Expand Up @@ -65,6 +66,7 @@ parse_vector <- function(x, collector, na = c("", "NA"), locale = default_locale
#' each field before parsing it?
#' @inheritParams parse_vector
#' @family parsers
#' @return a parsed vector
#' @examples
#' parse_integer(c("1", "2", "3"))
#' parse_double(c("1", "2", "3.123"))
Expand Down Expand Up @@ -129,11 +131,7 @@ col_character <- function() {
collector("character")
}

#' Skip a column
#'
#' Use this function to ignore a column when parsing.
#' To skip all columns not otherwise specified, use [cols_only()].
#'
#' @rdname cols
#' @family parsers
#' @export
col_skip <- function() {
Expand All @@ -150,6 +148,7 @@ col_skip <- function() {
#' @return A numeric vector (double) of parsed numbers.
#' @family parsers
#' @export
#' @return a parsed vector
#' @examples
#' ## These all return 1000
#' parse_number("$1,000") ## leading `$` and grouping character `,` ignored
Expand Down Expand Up @@ -187,6 +186,7 @@ col_number <- function() {
#' @param guess_integer If `TRUE`, guess integer types for whole numbers, if
#' `FALSE` guess numeric type for all numbers.
#' @family parsers
#' @return a parsed vector
#' @export
#' @examples
#' # Logical vectors
Expand Down Expand Up @@ -232,6 +232,7 @@ guess_parser <- function(x, locale = default_locale(), guess_integer = FALSE, na
#' is included in the levels of the constructed factor.
#'
#' @inheritParams parse_atomic
#' @return a parsed vector
#' @family parsers
#' @export
#' @examples
Expand Down Expand Up @@ -464,6 +465,7 @@ col_time <- function(format = "") {
#' ASCII? This is useful if you're dealing with ASCII data where the correct
#' spellings have been lost. Requires the \pkg{stringi} package.
#' @export
#' @return a list / S3 object representing the locale information
#' @examples
#' locale()
#' locale("fr")
Expand Down Expand Up @@ -569,6 +571,7 @@ check_encoding <- function(x) {
#' @param mon,mon_ab Full and abbreviated month names.
#' @param day,day_ab Full and abbreviated week day names. Starts with Sunday.
#' @param am_pm Names used for AM and PM.
#' @return a list / S3 object representing data time
#' @export
#' @examples
#' date_names_lang("en")
Expand Down Expand Up @@ -649,6 +652,7 @@ is.date_names <- function(x) inherits(x, "date_names")
#' @param .default Any named columns not explicitly overridden in `...`
#' will be read with this column type.
#' @export
#' @return a list / S3 object representing column specification
#' @examples
#' cols(a = col_integer())
#' cols_only(a = col_integer())
Expand Down Expand Up @@ -722,6 +726,7 @@ is.col_spec <- function(x) inherits(x, "col_spec")
#' @keywords internal
#' @examples
#' as.col_spec("cccnnn")
#' @return a list / S3 object representing column specification
#' @export
as.col_spec <- function(x) UseMethod("as.col_spec")
#' @export
Expand Down
1 change: 1 addition & 0 deletions R/type_convert.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#' @inheritParams parse_guess
#' @note `type_convert()` removes a 'spec' attribute (if it presents).
#' @export
#' @return A data frame
#' @examples
#' df <- data.frame(
#' x = as.character(runif(10)),
Expand Down
3 changes: 3 additions & 0 deletions man/as.col_spec.Rd

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

23 changes: 0 additions & 23 deletions man/col_skip.Rd

This file was deleted.

17 changes: 15 additions & 2 deletions man/cols.Rd

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

3 changes: 3 additions & 0 deletions man/date_names.Rd

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

3 changes: 3 additions & 0 deletions man/locale.Rd

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

4 changes: 3 additions & 1 deletion man/parse_atomic.Rd

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

1 change: 0 additions & 1 deletion man/parse_datetime.Rd

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

4 changes: 3 additions & 1 deletion man/parse_factor.Rd

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

4 changes: 3 additions & 1 deletion man/parse_guess.Rd

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

3 changes: 2 additions & 1 deletion man/parse_number.Rd

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

4 changes: 3 additions & 1 deletion man/parse_vector.Rd

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

3 changes: 3 additions & 0 deletions man/type_convert.Rd

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

0 comments on commit 10a046d

Please sign in to comment.