Skip to content

Commit

Permalink
remove unused R functions
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Sep 29, 2016
1 parent 67de5dc commit 8260deb
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 113 deletions.
12 changes: 0 additions & 12 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ arrange_impl <- function(data, dots) {
.Call('dplyr_arrange_impl', PACKAGE = 'dplyr', data, dots)
}

order_impl <- function(args, env) {
.Call('dplyr_order_impl', PACKAGE = 'dplyr', args, env)
}

sort_impl <- function(data) {
.Call('dplyr_sort_impl', PACKAGE = 'dplyr', data)
}

#' Do values in a numeric vector fall in specified range?
#'
#' This is a shortcut for \code{x >= left & x <= right}, implemented
Expand Down Expand Up @@ -157,10 +149,6 @@ equal_data_frame <- function(x, y, ignore_col_order = TRUE, ignore_row_order = T
.Call('dplyr_equal_data_frame', PACKAGE = 'dplyr', x, y, ignore_col_order, ignore_row_order, convert)
}

all_equal_data_frame <- function(args, env) {
.Call('dplyr_all_equal_data_frame', PACKAGE = 'dplyr', args, env)
}

union_data_frame <- function(x, y) {
.Call('dplyr_union_data_frame', PACKAGE = 'dplyr', x, y)
}
Expand Down
27 changes: 0 additions & 27 deletions R/tbl-df.r
Original file line number Diff line number Diff line change
Expand Up @@ -227,30 +227,3 @@ anti_join.tbl_df <- function(x, y, by = NULL, copy = FALSE, ...) {
distinct_.tbl_df <- function(.data, ..., .dots) {
tbl_df(NextMethod())
}


# Other methods that currently don't have a better home -----------------------

order_ <- function(..., data){
parent_frame <- parent.frame()
if(missing(data)) {
env <- parent_frame
} else {
env <- as.environment(data)
parent.env(env) <- parent_frame
}
order_impl(dots(...) , env)
}

equal_ <- function(x, y){
equal_data_frame(x, y)
}

all_equal_ <- function(...){
env <- parent.frame()
all_equal_data_frame(dots(...), env)
}

sort_ <- function(data){
sort_impl(data)
}
35 changes: 0 additions & 35 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,6 @@ BEGIN_RCPP
return rcpp_result_gen;
END_RCPP
}
// order_impl
IntegerVector order_impl(List args, Environment env);
RcppExport SEXP dplyr_order_impl(SEXP argsSEXP, SEXP envSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< List >::type args(argsSEXP);
Rcpp::traits::input_parameter< Environment >::type env(envSEXP);
rcpp_result_gen = Rcpp::wrap(order_impl(args, env));
return rcpp_result_gen;
END_RCPP
}
// sort_impl
DataFrame sort_impl(DataFrame data);
RcppExport SEXP dplyr_sort_impl(SEXP dataSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< DataFrame >::type data(dataSEXP);
rcpp_result_gen = Rcpp::wrap(sort_impl(data));
return rcpp_result_gen;
END_RCPP
}
// between
LogicalVector between(NumericVector x, double left, double right);
RcppExport SEXP dplyr_between(SEXP xSEXP, SEXP leftSEXP, SEXP rightSEXP) {
Expand Down Expand Up @@ -454,18 +431,6 @@ BEGIN_RCPP
return rcpp_result_gen;
END_RCPP
}
// all_equal_data_frame
dplyr::BoolResult all_equal_data_frame(List args, Environment env);
RcppExport SEXP dplyr_all_equal_data_frame(SEXP argsSEXP, SEXP envSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< List >::type args(argsSEXP);
Rcpp::traits::input_parameter< Environment >::type env(envSEXP);
rcpp_result_gen = Rcpp::wrap(all_equal_data_frame(args, env));
return rcpp_result_gen;
END_RCPP
}
// union_data_frame
DataFrame union_data_frame(DataFrame x, DataFrame y);
RcppExport SEXP dplyr_union_data_frame(SEXP xSEXP, SEXP ySEXP) {
Expand Down
28 changes: 0 additions & 28 deletions src/arrange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,31 +63,3 @@ List arrange_impl(DataFrame data, LazyDots dots) {
SET_ATTRIB(res, strip_group_attributes(res));
return res;
}

// [[Rcpp::export]]
IntegerVector order_impl(List args, Environment env) {
int nargs = args.size();
SEXP tmp;
List variables(nargs);
LogicalVector ascending(nargs);
for (int i=0; i<nargs; i++) {
tmp = args[i];
if (TYPEOF(tmp) == LANGSXP && CAR(tmp) == Rf_install("desc")) {
variables[i] = Rf_eval(CAR(CDR(tmp)), env);
ascending[i] = false;
} else {
variables[i] = Rf_eval(tmp, env);
ascending[i] = true;
}
}
OrderVisitors o(variables,ascending, nargs);
IntegerVector res = o.apply();
res = res + 1;
return res;
}

// [[Rcpp::export]]
DataFrame sort_impl(DataFrame data) {
IntegerVector index = OrderVisitors(data).apply();
return DataFrameSubsetVisitors(data, data.names()).subset(index, "data.frame");
}
11 changes: 0 additions & 11 deletions src/set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,17 +222,6 @@ dplyr::BoolResult equal_data_frame(DataFrame x, DataFrame y, bool ignore_col_ord
return yes();
}

// [[Rcpp::export]]
dplyr::BoolResult all_equal_data_frame(List args, Environment env) {
int n = args.size();
DataFrame x0 = Rf_eval(args[0], env);
for (int i=1; i<n; i++) {
BoolResult test = equal_data_frame(x0, Rf_eval(args[i], env));
if (!test) return test;
}
return yes();
}

// [[Rcpp::export]]
DataFrame union_data_frame(DataFrame x, DataFrame y) {
BoolResult compat = compatible_data_frame(x,y,true,true);
Expand Down

0 comments on commit 8260deb

Please sign in to comment.