Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes for dplyr 1.0.0 #118

Merged
merged 1 commit into from
May 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Description: A graph, while not "tidy" in itself, can be thought of as two tidy
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.1.1
RoxygenNote: 7.1.0
Roxygen: list(markdown = TRUE)
Imports:
tibble,
Expand Down
10 changes: 6 additions & 4 deletions R/pull.R
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#' @export
#' @importFrom dplyr pull
pull.tbl_graph <- function(.data, var = -1) {
pull.tbl_graph <- function(.data, var = -1, name = NULL) {
d_tmp <- as_tibble(.data)
var <- enquo(var)
pull(d_tmp, !! var)
name <- enquo(name)
pull(d_tmp, !! var, !! name)
thomasp85 marked this conversation as resolved.
Show resolved Hide resolved
}
#' @export
#' @importFrom dplyr pull
pull.morphed_tbl_graph <- function(.data, var) {
pull.morphed_tbl_graph <- function(.data, var, name = NULL) {
var <- enquo(var)
lapply(.data, pull, !! var)
name <- enquo(var)
lapply(.data, pull, !! var, !! name)
thomasp85 marked this conversation as resolved.
Show resolved Hide resolved
}
#' @export
dplyr::pull
2 changes: 1 addition & 1 deletion tests/testthat/test-bind.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test_that('bind_nodes works', {
gr1 <- tbl_graph(head(mtcars))
gr1 <- bind_nodes(gr1, tail(mtcars))
tbl <- dplyr::bind_rows(head(mtcars), tail(mtcars))
expect_equal(as_tibble(gr1), tbl)
expect_equivalent(as_tibble(gr1), tbl)
thomasp85 marked this conversation as resolved.
Show resolved Hide resolved
})
test_that('bind_edges works', {
gr1 <- create_notable('bull') %>%
Expand Down