Skip to content

Commit

Permalink
Use first from dplyr (OK as eval in dplyr call)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace committed Nov 11, 2016
1 parent 3cd6b72 commit af86353
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion R/oneway.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ onewayid.data.frame <- function(x, attrib, id1 = names(x)[1], id2 = names(x)[2])
x_oneway <- dplyr::group_by_(x, quote(stplanr.key)) %>%
dplyr::mutate(is_two_way = ifelse(n() > 1, TRUE, FALSE)) %>%
dplyr::mutate_each("sum", attrib) %>%
dplyr::summarise_each_(funs("stplanr.first"), c(as.name(id1), as.name(id2), attrib, ~is_two_way))
dplyr::summarise_each_(dplyr::funs("first"), c(as.name(id1), as.name(id2), attrib, ~is_two_way))

x_oneway$stplanr.key <- NULL

Expand Down
4 changes: 0 additions & 4 deletions R/overline.R
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,4 @@ onewaygeo <- function(x, attrib){
return(singlelines)
}

stplanr.first <- function(...) {
dplyr::first(...)
}

`%>%` <- dplyr::`%>%`

0 comments on commit af86353

Please sign in to comment.