-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update data_findcols.R * Update test-get_columns.R * Update test-data_relocate.R * add tests * Update test-data_remove.R * Update data_relocate.R * Update test-data_rename.R * Update test-convert_na_to.R * fix weighted_median * add format-method * docs, add alias * docs * typo
- Loading branch information
1 parent
603ccfb
commit c97eed4
Showing
8 changed files
with
88 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#' @rdname find_columns | ||
#' @export | ||
get_columns <- function(data, | ||
select = NULL, | ||
exclude = NULL, | ||
ignore_case = FALSE, | ||
regex = FALSE, | ||
verbose = TRUE, | ||
...) { | ||
columns <- .select_nse( | ||
select, | ||
data, | ||
exclude, | ||
ignore_case = ignore_case, | ||
regex = regex, | ||
verbose = FALSE | ||
) | ||
|
||
# save attributes | ||
a <- attributes(data) | ||
|
||
if (!length(columns) || is.null(columns)) { | ||
if (isTRUE(verbose)) { | ||
warning(insight::format_message("No column names that matched the required search pattern were found."), call. = FALSE) | ||
} | ||
return(NULL) | ||
} | ||
|
||
out <- data[columns] | ||
|
||
# add back attributes | ||
attributes(out) <- utils::modifyList(a, attributes(out)) | ||
out | ||
} | ||
|
||
|
||
#' @rdname find_columns | ||
#' @export | ||
data_select <- get_columns |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
c97eed4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@IndrajeetPatil I think you need to update snapshot tests here, everything else should be ok.