EricMarcon / entropart

Compare dfb7096 ... +1 ... 7f8e6b2


@@ -8,9 +8,6 @@
Loading
8 8
ShannonBeta.ProbaVector <-
9 9
function(NorP, NorPexp = NULL, ..., CheckArguments = TRUE, Ps = NULL, Pexp = NULL) 
10 10
{
11 -
  if (CheckArguments)
12 -
    CheckentropartArguments()
13 -
  
14 11
  if (missing(NorP)){
15 12
    if (!missing(Ps)) {
16 13
      NorP <- Ps

@@ -8,9 +8,6 @@
Loading
8 8
PhyloBetaEntropy.ProbaVector <-
9 9
function(NorP, NorPexp = NULL, q = 1, Tree, Normalize = TRUE, ..., CheckArguments = TRUE, Ps = NULL, Pexp = NULL) 
10 10
{
11 -
  if (CheckArguments)
12 -
    CheckentropartArguments()
13 -
  
14 11
  if (missing(NorP)){
15 12
    if (!missing(Ps)) {
16 13
      NorP <- Ps
@@ -25,6 +22,9 @@
Loading
25 22
      stop("An argument NorPexp or Pexp must be provided.")
26 23
    }
27 24
  }
25 +
26 +
  if (CheckArguments)
27 +
    CheckentropartArguments()
28 28
  
29 29
  # Prepare NorP
30 30
  PandPexp <- matrix(c(NorP, NorPexp), nrow = length(NorP), ncol = 2, dimnames = list(names(NorP), c("Ps", "Pexp")))

@@ -8,9 +8,6 @@
Loading
8 8
HqzBeta.ProbaVector <-
9 9
function(NorP, NorPexp = NULL, q = 1, Z = diag(length(NorP)), ..., CheckArguments = TRUE, Ps = NULL, Pexp = NULL) 
10 10
{
11 -
  if (CheckArguments)
12 -
    CheckentropartArguments()
13 -
  
14 11
  if (missing(NorP)){
15 12
    if (!missing(Ps)) {
16 13
      NorP <- Ps
@@ -26,6 +23,8 @@
Loading
26 23
    }
27 24
  }
28 25
  
26 +
  if (CheckArguments)
27 +
    CheckentropartArguments()
29 28
  
30 29
  if (length(NorP) != length(NorPexp)) {
31 30
    stop("NorP and NorPexp should have the same length.")

@@ -8,9 +8,6 @@
Loading
8 8
TsallisBeta.ProbaVector <-
9 9
function(NorP, NorPexp = NULL, q = 1, ..., CheckArguments = TRUE, Ps = NULL, Pexp = NULL) 
10 10
{
11 -
  if (CheckArguments)
12 -
    CheckentropartArguments()
13 -
  
14 11
  if (missing(NorP)){
15 12
    if (!missing(Ps)) {
16 13
      NorP <- Ps
@@ -27,7 +24,10 @@
Loading
27 24
  }
28 25
  if (length(NorP) != length(NorPexp)) {
29 26
    stop("NorP and NorPexp should have the same length.")
30 -
  }  
27 +
  }
28 +
  
29 +
  if (CheckArguments)
30 +
    CheckentropartArguments()
31 31
  
32 32
  dataBeta <- NorP^q * lnq(NorP/NorPexp, q)
33 33
  dataBeta[NorP == 0] <- 0

@@ -14,12 +14,14 @@
Loading
14 14
    return (TRUE)
15 15
  }
16 16
  
17 -
  ErrorFunction <- paste("Error in ", ParentFunction, ":")
18 -
  
19 17
  # Find the arguments. match.fun does not work with entropart::function
20 -
  ParentFunctionNoNS <- as.name(gsub("entropart::", "", as.character(ParentFunction)))
18 +
  # as.character creates a vector. The name of the function is the last item
19 +
  ParentFunction_split <- as.character(ParentFunction)
20 +
  ParentFunctionNoNS <- ParentFunction_split[length(ParentFunction_split)]
21 21
  Args <- formals(match.fun(ParentFunctionNoNS))
22 -
22 +
  
23 +
  ErrorFunction <- paste("Error in ", ParentFunctionNoNS, ":")
24 +
  
23 25
  ErrorMessage <- function(Message, Argument) {
24 26
    cat(deparse(substitute(Argument)), "cannot be:\n")
25 27
    print(utils::head(Argument))

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
R -0.04% 76.18%
Project Totals (59 files) 76.18%
Loading