Skip to content

Commit

Permalink
fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nutterb committed Jul 27, 2018
1 parent 9a4eb66 commit 4012bd4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 3 additions & 7 deletions R/extract_labelled.R
Expand Up @@ -5,8 +5,8 @@
#'
#' @param x An atomic vector inheriting the \code{labelled} class.
#' @param i The elements to extract.
#' @param value typically a vector of similar class of length \code{i}
#' @param ... Arguments to pass to other methods.
#' @param value typically a vector of similar class of length \code{i}
#'
#' @seealso \code{\link{Extract}}
#'
Expand All @@ -31,14 +31,10 @@
#' @rdname extract_labelled
#' @export

`[<-.labelled` <- function(x, i, value, ...){
# x_new <- x
# class(x_new) <- class(x_new)[!class(x_new) %in% "labelled"]
# x_new[i] <- value
`[<-.labelled` <- function(x, i, ..., value){
structure(
# x_new,
NextMethod(),
label = attr(x, "label"),
class = c("labelled", class(x_new))
class = c("labelled", class(x)[!class(x) %in% "labelled"])
)
}
7 changes: 5 additions & 2 deletions man/get_label.Rd

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

0 comments on commit 4012bd4

Please sign in to comment.