get_network_by_id: Retrieve network information, nodes, edges and references for...

View source: R/get_network_by_id.R

get_network_by_idR Documentation

Retrieve network information, nodes, edges and references for a given set of Mangal network IDs

Description

Summarize mgNetwork properties.

Summarize mgNetworksCollection properties.

Usage

get_network_by_id(ids, as_sf = FALSE, force_collection = FALSE, verbose = TRUE)

get_network_by_id_indiv(id, as_sf = FALSE, verbose = TRUE)

## S3 method for class 'mgNetwork'
print(x, ...)

## S3 method for class 'mgNetworksCollection'
print(x, ...)

## S3 method for class 'mgNetwork'
summary(object, ...)

## S3 method for class 'mgNetworksCollection'
summary(object, ...)

Arguments

ids

a vector of Mangal ID for networks (numeric).

as_sf

a logical. Should networks metadata be converted into an sf object? Note that to use this feature sf must be installed.

force_collection

a logical. Should the output to be of class mgNetworksCollection even if it includes only one network.

verbose

a logical. Should extra information be reported on progress?

id

a single ID network (numeric).

x

an object of class mgNetwork or mgNetworksCollection.

...

ignored.

object

object of of class mgNetwork or mgNetworksCollection.

Value

A mgNetwork object includes five data frames:

  • network: includes all generic information on the network (if as_sf=TRUE then it is an object of class sf);

  • nodes: information pertaining to nodes (includes taxonomic information);

  • interactions: includes ecological interactions and their attributes;

  • dataset: information pertaining to the original dataset;

  • reference: details about the original publication.

A summary method is available for objects of class mgNetwork object and returns the following network properties:

  • the number of nodes;

  • the number of edges;

  • the connectance;

  • the linkage density;

  • the degree (in, out an total) and the eigenvector centrality of every nodes.

Functions

  • get_network_by_id_indiv(): Retrieve a network by its collection of networks (default).

Examples


 net18 <- get_network_by_id(id = 18)
 net18_c <- get_network_by_id(id = 18, force_collection = TRUE)
 nets <- get_network_by_id(id = c(18, 23))


rmangal documentation built on March 31, 2023, 10:27 p.m.