Skip to content

Commit

Permalink
Be ready for tidyr v1.0.0
Browse files Browse the repository at this point in the history
Main objective: get rid of the call to `tidyr::nest_()`. Secondary objective: write code that also works with CRAN tidyr.
  • Loading branch information
jennybc committed Aug 4, 2019
1 parent 7c4ad72 commit a39fc46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Depends: R (>= 2.10)
Imports:
stringdist,
stringr,
dplyr,
dplyr (>= 0.7.5),
tidyr (>= 0.4.0),
purrr,
geosphere
Expand Down
6 changes: 3 additions & 3 deletions R/genome_join.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ genome_join <- function(x, y, by = NULL, mode = "inner", ...) {
# nest around the chromosome column
x$..index <- seq_len(nrow(x))
y$..index <- seq_len(nrow(y))
nested_x <- tidyr::nest_(x, "x_data", colnames(x)[-1])
nested_y <- tidyr::nest_(y, "y_data", colnames(y)[-1])
nested_x <- tidyr::nest(dplyr::group_by_at(x, .vars = 1))
nested_y <- tidyr::nest(dplyr::group_by_at(y, .vars = 1))
by <- c(colnames(nested_y)[1])
names(by) <- colnames(nested_x)[1]

Expand All @@ -76,7 +76,7 @@ genome_join <- function(x, y, by = NULL, mode = "inner", ...) {
data.frame(x = xd$..index[o$queryHits], y = yd$..index[o$subjectHits])
}

ret <- purrr::map2_df(joined$x_data, joined$y_data, find_overlaps)
ret <- purrr::map2_df(joined$data.x, joined$data.y, find_overlaps)
ret
}

Expand Down

0 comments on commit a39fc46

Please sign in to comment.