X-Git-Url: https://git.auder.net/?p=morpheus.git;a=blobdiff_plain;f=pkg%2FR%2FsampleIO.R;fp=pkg%2FR%2FsampleIO.R;h=230b63cd5ac42ba09e36e3df788f41e1f21646e5;hp=10497dbb487801f7f2d372a530b86217bfa493a7;hb=2b3a6af5c55ac121405e3a8da721626ddf46b28b;hpb=2989133a738da99b78594cb00afdd3d87916b8bd diff --git a/pkg/R/sampleIO.R b/pkg/R/sampleIO.R index 10497db..230b63c 100644 --- a/pkg/R/sampleIO.R +++ b/pkg/R/sampleIO.R @@ -17,6 +17,12 @@ #' \item{index: the population index (in 1:K) for each row in X} #' } #' +#' @examples +#' # K = 3 so we give first two components of p: 0.3 and 0.3 (p[3] = 0.4) +#' io <- generateSampleIO(1000, c(.3,.3), +#' matrix(c(1,3,-1,1,2,1),ncol=3), c(.5,-1,0), "logit") +#' io$index[1] #number of the group of X[1,] and Y[1] (in 1...K) +#' #' @export generateSampleIO = function(n, p, β, b, link) {