Learn R Programming

parallelpam (version 1.4.3)

GetJRow: GetJRow

Description

Returns (as a R numeric vector) the requested row number from the matrix contained in a jmatrix binary file

Usage

GetJRow(fname, nrow)

Value

A numeric vector with the values of elements in the requested row

Arguments

fname

String with the file name that contains the binary data.

nrow

The number of the row to be returned, in R-numbering (from 1)

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")
tmpfile1=paste0(tempdir(),"/Rfullfloat.bin")
JWriteBin(Rf,tmpfile1,dtype="float",dmtype="full",comment="Full matrix of floats")
Rf[3,]
vf<-GetJRow(tmpfile1,3)
vf

Run the code above in your browser using DataLab