Skip to content

Commit

Permalink
create man pages for cfactor and interlaced attribute setters
Browse files Browse the repository at this point in the history
  • Loading branch information
khusmann committed Jun 17, 2024
1 parent 3fd51fa commit 97a0f84
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 11 deletions.
7 changes: 6 additions & 1 deletion R/cfactor.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,13 @@ codes.default <- function(x, ...) {
attr(attr(x, "levels"), "codes")
}

#' @rdname codes
#' Set the codes for a `cfactor``
#'
#' Set the codes for a `cfactor`, similar to `levels<-()`
#'
#' @keywords internal
#' @param value a named vector of codes for the `cfactor`
#'
#' @export
`codes<-` <- function(x, value) {
UseMethod("codes")
Expand Down
6 changes: 4 additions & 2 deletions R/interlaced.R
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,9 @@ levels.interlacer_interlaced <- function(x) {
levels(value_channel(x))
}

#' Set the factor level attributes of `interlaced` vectors
#' @keywords internal
#' @param value A vector of new levels to set
#' @export
`levels<-.interlacer_interlaced` <- function(x, value) {
map_value_channel(x, \(v) `levels<-`(v, value))
Expand All @@ -504,8 +507,7 @@ na_levels <- function(x) {
levels(na_channel(x))
}

#' @rdname levels.interlacer_interlaced
#' @keywords internal
#' @rdname levels-set-.interlacer_interlaced
#' @export
`na_levels<-` <- function(x, value) {
map_na_channel(x, \(v) `levels<-`(v, value))
Expand Down
15 changes: 15 additions & 0 deletions man/codes-set.Rd

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

4 changes: 0 additions & 4 deletions man/codes.Rd

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

18 changes: 18 additions & 0 deletions man/levels-set-.interlacer_interlaced.Rd

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

4 changes: 0 additions & 4 deletions man/levels.interlacer_interlaced.Rd

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

0 comments on commit 97a0f84

Please sign in to comment.