toCX: Convert an RCX object to CX (JSON)

View source: R/Json-toJson.R

toCXR Documentation

Convert an RCX object to CX (JSON)


This function converts an RCX object to JSON in a valid CX data structure (see NDEx documentation:


toCX(rcx, verbose = FALSE, pretty = FALSE)



RCX object


logical; whether to print what is happening


logical; adds indentation whitespace to JSON output. Can be TRUE/FALSE or a number specifying the number of spaces to indent. See jsonlite::prettify()


The single aspects of the RCX object are processed by generic functions of rcxToJson for each aspect class. Therefore, not only the single aspects are converted to JSON, but also necessary additional aspects are added, so the resulting CX is accepted by the NDEx platform (

  • numberVerication shows the supported maximal number

  • status is needed at the end to show, that no errors have occurred while creation

If the RCX object contains additional aspects besides the officially defined ones, the corresponding rcxToJson functions for those aspect classes have to be implemented in order to include them in the resulting CX.


CX (JSON) text

See Also

toCX, rcxToJson, readCX, writeCX


rcx = createRCX(
  nodes = createNodes(
    name = LETTERS[seq_len(10)]
  edges = createEdges(
    target = c(2,3)

json = toCX(rcx, pretty=TRUE)

frankkramer-lab/RCX documentation built on Feb. 4, 2023, 5:12 p.m.