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

The revisions let you track differences between multiple versions of a post.

Wiki home page

Table of Contents 

Ideas 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...