recalculate.offdiagonals <- function (correl, .thisPop)
{
DUEenv = get('DUEenv', envir=parent.frame())
#DUEenv = get('DUEenv', envir = parent.frame(2))
#DUEget(c(nPops,the.correlations.pop,the.variances.pop,the.logmedians.pop))
if (missing(.thisPop)) {
for (..thisPop in 1:DUEenv$nPops)
recalculate.offdiagonals(correl=correl, .thisPop = ..thisPop )
return(NULL)
}
if (!missing(correl)) {
DUEenv$the.correlations.pop[[DUEenv$thisPop]] <- correl
# print(DUEenv$the.correlations.pop)
}
DUEenv$the.variances.pop[[.thisPop]][2, 1] <-
DUEenv$the.variances.pop[[.thisPop]][1, 2] <-
DUEenv$the.correlations.pop[[.thisPop]] *
sqrt(DUEenv$the.variances.pop[[.thisPop]][1, 1]) *
sqrt(DUEenv$the.variances.pop[[.thisPop]][2, 2])
return(NULL)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.