Skip to content

Commit

Permalink
started work on #35, extension packs
Browse files Browse the repository at this point in the history
  • Loading branch information
piccolbo committed Apr 2, 2014
1 parent bec9fb1 commit 1353185
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: plyrmr
Type: Package
Title: Data manipulation backed by rmr2 and Hadoop
Version: 0.2.0
Version: 0.3.0
Date: 2014-03-31
Author: Revolution Analytics
Maintainer: Revolution Analytics <rhadoop@revolutionanalytics.com>
Expand All @@ -10,4 +10,4 @@ Depends: rmr2 (>= 3.1.0), reshape2, dplyr
Imports: Rcpp (>= 0.10.4), plyr, R.methodsS3, Hmisc, functional
License: Apache License (== 2.0)
LinkingTo: Rcpp
Collate: RcppExports.R common.R big.data.R pipe.R dataframe.R aggregate.R arrange-like.R base.R reshape2.R sqlish.R
Collate: RcppExports.R common.R big.data.R pipe.R dataframe.R aggregate.R arrange-like.R base.R reshape2.R sqlish.R extensions.R
2 changes: 2 additions & 0 deletions pkg/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ S3method(dcast, pipe)
S3method(dcast, default)
S3method(melt, pipe)
S3method(melt, data.frame)
#other
export(extend)
#fast summaries
#export(fast.summary)
#S3method(fast.summary, pipe)
Expand Down
26 changes: 26 additions & 0 deletions pkg/R/extensions.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2014 Revolution Analytics
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


extend =
function(pack = c("base", "dplyr"), envir = parent.frame()) {
pack = match.arg(pack)
switch(
pack,
base = {
magic.wand(transform, TRUE, TRUE, envir = envir)
magic.wand(subset, TRUE, TRUE, envir = envir)},
dplyr = {
magic.wand(filter, TRUE, TRUE, envir = envir)
magic.wand(mutate, TRUE, TRUE, envir = envir)})}

0 comments on commit 1353185

Please sign in to comment.