library(knitr) opts_chunk$set(echo = FALSE, comment = NA)
# Pass arguments dfr <- params$dfr vars <- params$vars factors <- params$factors rep <- params$rep maxp <- params$maxp pe <- params$pe se <- params$se # Check factors structure out <- ck.fs(dfr, factors, rep) dfr <- out$dfr nf <- out$nf nl <- out$nl nrep <- out$nrep nmis.fac <- out$nmis.fac # Texts for levels text.levels <- out$nl[1] for (i in 2:(nf - 1)) text.levels <- paste0(text.levels, ', ', nl[i]) text.levels <- paste0(text.levels, ', and ', nl[nf]) # Text for design if (is.null(rep)) text.design <- 'completely randomized design' if (!is.null(rep)) text.design <- 'randomized complete block design' # Everything as character for (i in 1:nf) dfr[, factors[i]] <- as.character(dfr[, factors[i]]) if (!is.null(rep)) dfr[, rep] <- as.character(dfr[, rep])
The data frame has data for a full factorial with r nf
factors with r text.levels
levels. The experimental design is a r text.design
with r nrep
replications.
In this model we assume that the errors are independent and have a normal distribution with common variance.
r if (nmis.fac == 1) paste("Note: There is", nmis.fac, "row with missing values for classifications factors. This row has been deleted.")
r if (nmis.fac > 1) paste("Note: There are", nmis.fac, "rows with missing values for classifications factors. These rows have been deleted.")
out <- NULL for (i in 1:length(vars)) { lc <- ck.f(dfr, vars[i], factors, rep) if (lc$nt.0 == 0 & lc$nrep > 1 & lc$nt.mult == 0 & lc$pmis <= maxp) { out <- c(out, knit_expand('child_f.Rmd')) } else { out <- c(out, knit_expand('child_f_fail.Rmd')) } }
r paste(knit(text = out), collapse = '\n')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.