Description Usage Arguments Value Examples
Import network from asnr package Bansal lab's Animal Social Network Repository
1 2 3 4 5 6 7 8 9 10 11 |
class |
character scalar. Phylogenetic class folder of the network to import (e.g. "Aves","Mammalia",etc.). Supports partial matching. |
species |
character scalar. species folder of the network to import (e.g. "Aves","Mammalia",etc.). Needs to match the beginning of the folder's name Supports partial matching. |
network |
character scalar. Optional if the folder contains only one .graphml file. Otherwise the .graphml file name to import. Supports partial matching. |
url |
character scalar. Optional if argument |
output |
character scalar. Either "graph" for an |
type |
character scalar. One of "both", "upper", and "lower". In the case of undirected network, "upper" or "lower" should probably be preferred. |
... |
additional argument. Useful to pass a |
default_prefix |
character scalar. URL "prefix" used to retrieve the graphml file from github. |
full.path |
character scalar. Optional, can be used to input directly an URL to a graphml file. |
According to output, either a igraph object or an adjacency matrix.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
import_from_asnr("Aves","cowbird")
# partial matching works, but at the moment not case insensitive
import_from_asnr("Amph","frog",output = "adj")
# Users can also copy-paste a `.graphml`'s URL
# link split into two for line length reason. User can directly copy paste full links, however
import_from_asnr(
url = paste0(
"https://github.com/bansallab/asnr/blob/master/Networks/Reptilia/",
"lizard_proximity_weighted/weighted_network_social_T_rugosa.graphml"
)
)
# To avoid multiple get querries and longer computation time, users can first
# load a `asnr.df` data frame by calling once the `asnr_network_df` function
asnr.df <- asnr_network_df()
import_from_asnr("Amph","frog",output = "adj",asnr.df = asnr.df)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.