saveBSM | R Documentation |
Save symmetric matrix to a binary core file (.bin), and a text file of IDs (.id), recognizable by PLINK.
saveBSM(pfx, x, ltr = TRUE, diag = TRUE, unit = 4L, fid = ".")
pfx |
prefix of output files |
x |
symmetric matrix to save |
ltr |
store the lower triangle only? (def=TRUE) |
diag |
save diagnal? (def=TRUE) ignored if |
unit |
numerical unit, (def=4, single precision) |
fid |
separator between FID and IID (def="."). |
pfx <- file.path(system.file("extdata", package="plinkFile"), "m20.rel")
rel <- readBSM(pfx) # relatedness kernel matrix
re2 <- rel^2 # 2nd order polynomial kernel
tmp <- tempdir()
dir.create(tmp, FALSE)
out <- file.path(tmp, 'm20.re2')
saveBSM(out, re2) # save the polynomial kernel
dir(tmp) # show new files, then clean up
unlink(tmp, recursive=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.