EVOLUTION-MANAGER
Edit File: nexus.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Query and download from the Nexus network repository</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for print.nexusDatasetInfo {igraph}"><tr><td>print.nexusDatasetInfo {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Query and download from the Nexus network repository</h2> <h3>Description</h3> <p>The Nexus network repository is an online collection of network data sets. These functions can be used to query it and download data from it, directly as an igraph graph. </p> <h3>Usage</h3> <pre> ## S3 method for class 'nexusDatasetInfo' print(x, ...) ## S3 method for class 'nexusDatasetInfoList' summary(object, ...) ## S3 method for class 'nexusDatasetInfoList' print(x, ...) nexus_list( tags = NULL, offset = 0, limit = 10, operator = c("or", "and"), order = c("date", "name", "popularity"), nexus.url = igraph_opt("nexus.url") ) nexus_info(id, nexus.url = igraph_opt("nexus.url")) nexus_get( id, offset = 0, order = c("date", "name", "popularity"), nexus.url = igraph_opt("nexus.url") ) nexus_search( q, offset = 0, limit = 10, order = c("date", "name", "popularity"), nexus.url = igraph_opt("nexus.url") ) ## S3 method for class 'nexusDatasetInfoList' x[i] </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x, object</code></td> <td> <p>The <code>nexusDatasetInfo</code> object to print.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Currently ignored.</p> </td></tr> <tr valign="top"><td><code>tags</code></td> <td> <p>A character vector, the tags that are searched. If not given (or <code>NULL</code>), then all datasets are listed.</p> </td></tr> <tr valign="top"><td><code>offset</code></td> <td> <p>An offset to select part of the results. Results are listed from <code>offset</code>+1.</p> </td></tr> <tr valign="top"><td><code>limit</code></td> <td> <p>The maximum number of results to return.</p> </td></tr> <tr valign="top"><td><code>operator</code></td> <td> <p>A character scalar. If ‘or’ (the default), then all datasets that have at least one of the given tags, are returned. If it if ‘and’, then only datasets that have all the given tags, are returned.</p> </td></tr> <tr valign="top"><td><code>order</code></td> <td> <p>The ordering of the results, possible values are: ‘date’, ‘name’, ‘popularity’.</p> </td></tr> <tr valign="top"><td><code>nexus.url</code></td> <td> <p>The URL of the Nexus server. Don't change this from the default, unless you set up your own Nexus server.</p> </td></tr> <tr valign="top"><td><code>id</code></td> <td> <p>The numeric or character id of the data set to query or download. Instead of the data set ids, it is possible to supply a <code>nexusDatasetInfo</code> or <code>nexusDatasetInfoList</code> object here directly and then the query is done on the corresponding data set(s).</p> </td></tr> <tr valign="top"><td><code>q</code></td> <td> <p>Nexus search string. See examples below.</p> </td></tr> <tr valign="top"><td><code>i</code></td> <td> <p>Index.</p> </td></tr> </table> <h3>Details</h3> <p>Nexus is an online repository of networks, with an API that allow programmatic queries against it, and programmatic data download as well. </p> <p>The <code>nexus_list</code> and <code>nexus_info</code> functions query the online database. They both return <code>nexusDatasetInfo</code> objects. <code>nexus_info</code> returns more information than <code>nexus_list</code>. </p> <p><code>nexus_search</code> searches Nexus, and returns a list of data sets, as <code>nexusDatasetInfo</code> objects. See below for some search examples. </p> <p><code>nexus_get</code> downloads a data set from Nexus, based on its numeric id, or based on a Nexus search string. For search strings, only the first search hit is downloaded, but see also the <code>offset</code> argument. (If there are not data sets found, then the function returns an error.) </p> <p>The <code>nexusDatasetInfo</code> objects returned by <code>nexus_list</code> have the following fields: </p> <dl> <dt>id</dt><dd><p>The numeric id of the dataset.</p> </dd> <dt>sid</dt><dd><p>The character id of the dataset.</p> </dd> <dt>name</dt><dd><p>Character scalar, the name of the dataset.</p> </dd> <dt>vertices/edges</dt><dd><p>Character, the number of vertices and edges in the graph(s). Vertices and edges are separated by a slash, and if the data set consists of multiple networks, then they are separated by spaces.</p> </dd> <dt>tags</dt><dd><p>Character vector, the tags of the dataset. Directed graph have the tags ‘directed’. Undirected graphs are tagged as ‘undirected’. Other common tags are: ‘weighted’, ‘bipartite’, ‘social network’, etc.</p> </dd> <dt>networks</dt><dd><p>The ids and names of the networks in the data set. The numeric and character id are separated by a slash, and multiple networks are separated by spaces.</p> </dd> </dl> <p><code>nexusDatasetInfo</code> objects returned by <code>nexus_info</code> have the following additional fields: </p> <dl> <dt>date</dt><dd><p>Character scalar, e.g. ‘2011-01-09’, the date when the dataset was added to the database.</p> </dd> <dt>formats</dt><dd><p>Character vector, the data formats in which the data set is available. The various formats are separated by semicolons.</p> </dd> <dt>licence</dt><dd><p>Character scalar, the licence of the dataset.</p> </dd> <dt>licence url</dt><dd><p>Character scalar, the URL of the licence of the dataset. Please make sure you consult this before using a dataset.</p> </dd> <dt>summary</dt><dd><p>Character scalar, the short description of the dataset, this is usually a single sentence.</p> </dd> <dt>description</dt><dd><p>Character scalar, the full description of the dataset.</p> </dd> <dt>citation</dt><dd><p>Character scalar, the paper(s) describing the dataset. Please cite these papers if you are using the dataset in your research, the licence of most datasets requires this.</p> </dd> <dt>attributes</dt><dd><p>A list of lists, each list entry is a graph, vertex or edge attribute and has the following entries: </p> <dl> <dt>type</dt><dd><p>Type of the attribute, either ‘graph’, ‘vertex’ or ‘edge’.</p> </dd> <dt>datatype</dt><dd><p>Data type of the attribute, currently it can be ‘numeric’ and ‘string’.</p> </dd> <dt>name</dt><dd><p>Character scalar, the name of the attribute.</p> </dd> <dt>description</dt><dd><p>Character scalar, the description of the attribute.</p> </dd> </dl> </dd> </dl> <p>The results of the Nexus queries are printed to the screen in a consise format, similar to the format of igraph graphs. A data set list (typically the result of <code>nexus_list</code> and <code>nexus_search</code>) looks like this: </p> <pre>NEXUS 1-5/18 -- data set list [1] kaptail.4 39/109-223 #18 Kapferer tailor shop [2] condmatcollab2003 31163/120029 #17 Condensed matter collaborations+ [3] condmatcollab 16726/47594 #16 Condensed matter collaborations+ [4] powergrid 4941/6594 #15 Western US power grid [5] celegansneural 297/2359 #14 C. Elegans neural network </pre> <p>Each line here represents a data set, and the following information is given about them: the character id of the data set (e.g. <code>kaptail</code> or <code>powergrid</code>), the number of vertices and number of edges in the graph of the data sets. For data sets with multiple graphs, intervals are given here. Then the numeric id of the data set and the remaining space is filled with the name of the data set. </p> <p>Summary information about an individual Nexus data set is printed as </p> <pre>NEXUS B--- 39 109-223 #18 kaptail -- Kapferer tailor shop + tags: directed; social network; undirected + nets: 1/KAPFTI2; 2/KAPFTS2; 3/KAPFTI1; 4/KAPFTS1</pre> <p>This is very similar to the header that is used for printing igraph graphs, but there are some differences as well. The four characters after the <code>NEXUS</code> word give the most important properties of the graph(s): the first is ‘<code>U</code>’ for undirected and ‘<code>D</code>’ for directed graphs, and ‘<code>B</code>’ if the data set contains both directed and undirected graphs. The second is ‘<code>N</code>’ named graphs. The third character is ‘<code>W</code>’ for weighted graphs, the fourth is ‘<code>B</code>’ if the data set contains bipartite graphs. Then the number of vertices and number of edges are printed, for data sets with multiple graphs, the smallest and the largest values are given. Then comes the numeric id, and the string id of the data set. The end of the first line contains the name of the data set. The second row lists the data set tags, and the third row the networks that are included in the data set. </p> <p>Detailed data set information is printed similarly, but it contains more fields. </p> <h3>Value</h3> <p><code>nexus_list</code> and <code>nexus_search</code> return a list of <code>nexusDatasetInfo</code> objects. The list also has these attributes: </p> <dl> <dt>size</dt><dd><p>The number of data sets returned by the query.</p> </dd> <dt>totalsize</dt><dd><p>The total number of data sets found for the query.</p> </dd> <dt>offset</dt><dd><p>The offset parameter of the query.</p> </dd> <dt>limit</dt><dd><p>The limit parameter of the query.</p> </dd> </dl> <p><code>nexus_info</code> returns a single <code>nexusDatasetInfo</code> object. </p> <p><code>nexus_get</code> returns an igraph graph object, or a list of graph objects, if the data set consists of multiple networks. </p> <h3>Examples</h3> <pre> nexus_list(tag="weighted") nexus_list(limit=3, order="name") nexus_list(limit=3, order="name")[[1]] nexus_info(2) g <- nexus_get(2) summary(g) ## Data sets related to 'US': nexus_search("US") ## Search for data sets that have 'network' in their name: nexus_search("name:network") ## Any word can match nexus_search("blog or US or karate") </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>