rcx_new: Create a blank rcx object

Description Usage Arguments Value Examples

View source: R/ndex_RCX.r

Description

This function generates a (blank) RCX object. For a valid RCX, at least one node has to be specified. Optional attributes are 'n' for names and 'r' for represents. Ids have to be unique (in nodes) and may not contain 'NA' values. For names and represents attributes, 'NA' values are allowed.

Usage

1
rcx_new(nodes = c(`@id` = 1))

Arguments

nodes

vector or data.frame (default: c('@id'=1) ) node(s)

Value

RCX object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
rcx = rcx_new()
rcx = rcx_new(c('@id'=1))                                #same as one before
rcx = rcx_new(nodes=c('@id'=1))                          #same as one before
rcx = rcx_new(data.frame('@id'=c(1), check.names=FALSE))     #same as one before
rcx = rcx_new(c('@id'=1, n='Some Name'))
rcx = rcx_new(c('@id'=1, n='Some Name', r='HGNC:Symbol'))
#same as one before:
rcx = rcx_new(data.frame('@id'=c(1),n=c('Some Name'), r=c('HGNC:Symbol'), check.names=FALSE))
rcx = rcx_new(data.frame('@id'=c(1,2,3),n=c('Some Name','And another name',NA),
                         r=c('HGNC:Symbol',NA,'UniProt:C3P0'), check.names=FALSE))

Example output

Loading required package: igraph

Attaching package:igraphThe following objects are masked frompackage:stats:

    decompose, spectrum

The following object is masked frompackage:base:

    union

ndexr documentation built on March 13, 2021, 2 a.m.