Learn R Programming

LorMe (version 1.1.0)

NC_remove: Natural connectivity analysis

Description

Natural connectivity analysis

Usage

NC_remove(input, num, seed = 1)

Value

NC_remove returns data frame with removed nodes and corresponding natural connectivity

Arguments

input

Network adjacency matrix. Can be generated by network_analysis

num

Max number of removed nodes. Default: Automatically match max number that can be removed.

seed

Random seed Number to be set. Default: 1. See in set.seed

Author

Wang Ningqi2434066068@qq.com

Examples

Run this code
{
  ### Data preparation ###
  data("Two_group")

  ### One input network analysis ###
  network_results <- network_analysis(
    taxobj = Two_group,
    taxlevel = "Base",
    reads = FALSE,
    n = 10,
    threshold = 0.6
  )

  network_matrix <- as.data.frame(network_results[[3]])  # Complete adjacency matrix

  # Check initial natural connectivity
  nc <- nc(network_matrix)

  # Conduct natural connectivity analysis
  nc_remove <- NC_remove(input = network_matrix)
  head(nc_remove)
  tail(nc_remove)

  # Set target number for natural connectivity analysis
  nc_remove <- NC_remove(input = network_matrix, num = 400)
}

Run the code above in your browser using DataLab