check_specs: Check an adjacency matrix object for directedness and...

Description Usage Arguments Value Examples

View source: R/check_specs.R

Description

This method allows different adjacency matrix classes to be checked.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
check_specs(object, ...)

## S3 method for class 'matrix'
check_specs(object, ...)

## S3 method for class 'dgTMatrix'
check_specs(object, ...)

## S3 method for class 'dgCMatrix'
check_specs(object, ...)

## S3 method for class 'sparseMatrix'
check_specs(object, ...)

## Default S3 method:
check_specs(object, ...)

Arguments

object

matrix to be analyzed. Different classes are allowed.

...

additional parameters to and from internal functions, currently not used.

Value

named boolean vector of length 2 whose first element is TRUE for directed 'objects' and whose second element is TRUE for 'object' with selfloops.

Examples

1
2
3
4
5
el <- data.frame(from= c('a','b','b','c','d','d'),
                to  = c('b','c','d','a','b','a'),
                attr= c( 12, 6, 12 , 6 , 6 , 6 ))
adj <- el2adj(el)
check_specs(adj)

gi0na/adjHelpR documentation built on Jan. 9, 2022, 11:38 p.m.