Skip to content

Commit

Permalink
remove inferr
Browse files Browse the repository at this point in the history
  • Loading branch information
aravindhebbali committed Dec 17, 2020
1 parent f231f82 commit d3bd860
Show file tree
Hide file tree
Showing 15 changed files with 155 additions and 5 deletions.
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Description: Tools for interactive data exploration built using 'shiny'. Include
Depends:
R(>= 3.2.4)
Imports:
Rcpp,
shiny,
utils
Suggests:
Expand All @@ -20,7 +21,6 @@ Suggests:
grid,
haven,
highcharter,
inferr,
jsonlite,
kableExtra,
magrittr,
Expand All @@ -41,3 +41,5 @@ License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.1
LinkingTo:
Rcpp
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export(app_logistic_regression)
export(app_rfm_analysis)
export(app_vistributions)
export(app_visualizer)
export(xpl_gvar)
export(xpl_nsignC)
importFrom(Rcpp,sourceCpp)
importFrom(utils,install.packages)
importFrom(utils,menu)
importFrom(utils,packageVersion)
useDynLib(xplorerr)
20 changes: 20 additions & 0 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Return sign
#'
#' @param x A numeric vector
#' @export
xpl_nsignC <- function(x) {
.Call('_xplorerr_xpl_nsignC', PACKAGE = 'xplorerr', x)
}

#' Repeat data
#'
#' @param ln A list
#' @param ly A list
#' @export
xpl_gvar <- function(ln, ly) {
.Call('_xplorerr_xpl_gvar', PACKAGE = 'xplorerr', ln, ly)
}

2 changes: 2 additions & 0 deletions R/xplorerr.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#' \href{https://github.com/rsquaredacademy/xplorerr}{GitHub}
#'
#' @docType package
#' @importFrom Rcpp sourceCpp
#' @useDynLib xplorerr
#' @name xplorerr
NULL

Expand Down
Binary file added data/exam.rda
Binary file not shown.
Binary file added data/hsb.rda
Binary file not shown.
Binary file added data/treatment.rda
Binary file not shown.
2 changes: 1 addition & 1 deletion inst/app-inferr/server.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
library(shiny)
library(data.table)
library(inferr)
library(dplyr)
library(purrr)
library(tidyr)
Expand All @@ -14,6 +13,7 @@ library(lubridate)
library(scales)
library(stringr)
library(rlang)
library(xplorerr)

shinyServer(function(input, output, session) {

Expand Down
6 changes: 3 additions & 3 deletions inst/app-inferr/xpl-helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ xpl_levene_test <- function(data, variables = NULL, group_var = "NULL",
stop("Please specify at least two variables.", call. = FALSE)
}

out <- inferr:::gvar(ln, ly)
out <- xpl_gvar(ln, ly)
fdata <- unlist(z)

groupvars <-
Expand Down Expand Up @@ -1387,7 +1387,7 @@ xpl_runs_test <- function(data, x, drop = FALSE,
unlist(use.names = FALSE)
}

n_runs <- inferr:::nsignC(x_binary)
n_runs <- xpl_nsignC(x_binary)
n1 <- sum(x_binary)
n0 <- length(x_binary) - n1
exp_runs <- expruns(n0, n1)
Expand Down Expand Up @@ -1605,7 +1605,7 @@ xpl_ts_var_test <- function(data, variables = NULL, group_var = "NULL",
stop("Please specify at least two variables.", call. = FALSE)
}

out <- inferr:::gvar(ln, ly)
out <- xpl_gvar(ln, ly)
fdata <- unlist(z)

groupvars <-
Expand Down
16 changes: 16 additions & 0 deletions man/xpl_gvar.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions man/xpl_nsignC.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.o
*.so
*.dll
41 changes: 41 additions & 0 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#include <Rcpp.h>

using namespace Rcpp;

// xpl_nsignC
double xpl_nsignC(NumericVector x);
RcppExport SEXP _xplorerr_xpl_nsignC(SEXP xSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
rcpp_result_gen = Rcpp::wrap(xpl_nsignC(x));
return rcpp_result_gen;
END_RCPP
}
// xpl_gvar
List xpl_gvar(NumericVector ln, NumericVector ly);
RcppExport SEXP _xplorerr_xpl_gvar(SEXP lnSEXP, SEXP lySEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< NumericVector >::type ln(lnSEXP);
Rcpp::traits::input_parameter< NumericVector >::type ly(lySEXP);
rcpp_result_gen = Rcpp::wrap(xpl_gvar(ln, ly));
return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
{"_xplorerr_xpl_nsignC", (DL_FUNC) &_xplorerr_xpl_nsignC, 1},
{"_xplorerr_xpl_gvar", (DL_FUNC) &_xplorerr_xpl_gvar, 2},
{NULL, NULL, 0}
};

RcppExport void R_init_xplorerr(DllInfo *dll) {
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
R_useDynamicSymbols(dll, FALSE);
}
26 changes: 26 additions & 0 deletions src/xpl-nsign.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include <Rcpp.h>
using namespace Rcpp;

//' Return sign
//'
//' @param x A numeric vector
//' @export
// [[Rcpp::export]]
double xpl_nsignC(NumericVector x) {

int n = x.size();
int count = 1;

for(int i = 1; i < n; i++) {
int l = i - 1;
if(x[i] != x[l]) {
count++;
}
}

return count;
}




22 changes: 22 additions & 0 deletions src/xpl-tvar.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <Rcpp.h>
using namespace Rcpp;

//' Repeat data
//'
//' @param ln A list
//' @param ly A list
//' @export
// [[Rcpp::export]]
List xpl_gvar(NumericVector ln, NumericVector ly) {

int n = ly.size();
List out(n);

for(int i = 0; i < n; i++) {
out[i] = rep(i, ln[i]);
}

return out;

}

0 comments on commit d3bd860

Please sign in to comment.