X-Git-Url: https://git.auder.net/?p=morpheus.git;a=blobdiff_plain;f=pkg%2FR%2FsampleIO.R;h=9419c32c12c7cca866251a0e2c8129677d230924;hp=230b63cd5ac42ba09e36e3df788f41e1f21646e5;hb=ab35f6102896a49e86e853262c0650faa2931638;hpb=2b3a6af5c55ac121405e3a8da721626ddf46b28b diff --git a/pkg/R/sampleIO.R b/pkg/R/sampleIO.R index 230b63c..9419c32 100644 --- a/pkg/R/sampleIO.R +++ b/pkg/R/sampleIO.R @@ -4,6 +4,8 @@ #' into K groups of proportions p. Inside one group, the probability law P(Y=1) is #' described by the corresponding column parameter in the matrix β + intercept b. #' +#' @name generateSampleIO +#' #' @param n Number of individuals #' @param p Vector of K(-1) populations relative proportions (sum (<)= 1) #' @param β Vectors of model parameters for each population, of size dxK @@ -24,10 +26,10 @@ #' io$index[1] #number of the group of X[1,] and Y[1] (in 1...K) #' #' @export -generateSampleIO = function(n, p, β, b, link) +generateSampleIO <- function(n, p, β, b, link) { # Check arguments - tryCatch({n = as.integer(n)}, error=function(e) stop("Cannot convert n to integer")) + tryCatch({n <- as.integer(n)}, error=function(e) stop("Cannot convert n to integer")) if (length(n) > 1) warning("n is a vector but should be scalar: only first element used") if (n <= 0)