Learn R Programming

ChemmineR (version 2.24.2)

datablock2ma: SDF data blocks to matrix

Description

Convert data blocks in SDFset to character matrix with datablock2ma, then store its numeric columns as numeric matrix and its character columns as character matrix.

Usage

datablock2ma(datablocklist, cleanup = " \\(.*", ...)
splitNumChar(blockmatrix)

Arguments

datablocklist
list of data block vectors; can be created with datablock(sdfset)
blockmatrix
matrix returned by datablock2ma
cleanup
character pattern to be used to clean up the name fields of the data block vectors; the exact pattern matches are replaced by nothing (deleted).
...
option to pass on additional arguments

Value

datablock2ma
character matrix
splitNumChar
list with two components, a numeric matrix and a character matrix

Details

...

References

...

See Also

Classes: SDFset

Examples

Run this code

## SDFset instance
data(sdfsample)
sdfset <- sdfsample

# Convert data block to matrix  
blockmatrix <- datablock2ma(datablocklist=datablock(sdfset)) 
blockmatrix[1:4, 1:4]

# Split matrix to numeric matrix and character matrix
numchar <- splitNumChar(blockmatrix=blockmatrix)
names(numchar)
numchar[[1]][1:4,] 
numchar[[2]][1:4,] 

Run the code above in your browser using DataLab