Skip to content

Commit

Permalink
Update subtract to work with generics.R
Browse files Browse the repository at this point in the history
  • Loading branch information
cafreeman authored and Davies Liu committed Apr 14, 2015
1 parent f3ba785 commit ed66c81
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion R/pkg/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ exportMethods("columns",
"show",
"showDF",
"sortDF",
"subtract",
"toJSON",
"toRDD",
"unionAll",
Expand Down
9 changes: 6 additions & 3 deletions R/pkg/R/DataFrame.R
Original file line number Diff line number Diff line change
Expand Up @@ -1159,10 +1159,13 @@ setMethod("intersect",
#' df2 <- jsonFile(sqlCtx, path2)
#' subtractDF <- subtract(df, df2)
#' }

#' @rdname subtract
#' @export
setMethod("subtract",
signature(x = "DataFrame", y = "DataFrame"),
function(x, y) {
subtracted <- callJMethod(x@sdf, "except", y@sdf)
signature(x = "DataFrame", other = "DataFrame"),
function(x, other) {
subtracted <- callJMethod(x@sdf, "except", other@sdf)
dataFrame(subtracted)
})

Expand Down

0 comments on commit ed66c81

Please sign in to comment.