Learn R Programming

parallelpam (version 1.0)

GetJManyColsByNames: GetJManyColsByNames

Description

Returns (as a R numeric matrix) the columns with the requested column names from the matrix contained in a jmatrix binary file

Usage

GetJManyColsByNames(fname, extcolnames)

Value

A numeric matrix with the values of elements in the requested columns

Arguments

fname

String with the file name that contains the binary data.

extcolnames

A numeric vector with the names of the columns to be extracted. If the binary file has no column names, or _any_ of the column names is not present, an empty matrix is returned.

Examples

Run this code
Rf <- matrix(runif(48),nrow=6)
rownames(Rf) <- c("A","B","C","D","E","F")
colnames(Rf) <- c("a","b","c","d","e","f","g","h")
JWriteBin(Rf,"Rfullfloat.bin",dtype="float",dmtype="full",comment="Full matrix of floats")
Rf[,c(1,4)]
vf<-GetJManyColsByNames("Rfullfloat.bin",c("a","d"))
vf
file.remove("Rfullfloat.bin")

Run the code above in your browser using DataLab