You are here

Revision of helper-functions from Sun, 09/27/2009 - 06:45

Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.

Wiki home pageIdeas and example functions that extend OpenMx, encapsulate tedious work, and make scripts easier to write or more compact.

Read a Lower triangle file


 readLowerDiagonal <- function(file) {
    n <- max(count.fields(file))
    x <- read.table(file, fill = TRUE, col.names = 1:n)
    x[upper.tri(x)] <- t(x)[upper.tri(x)]

nb: Not industrial strength - requires that the file keeps rows on one line...