# [[.igraph

0th

Percentile

##### Query and manipulate a graph as it were an adjacency list

Query and manipulate a graph as it were an adjacency list

##### Usage
## S3 method for class 'igraph':
[[(x, i, j, from, to, ..., directed = TRUE, edges = FALSE,
exact = TRUE)
##### Arguments
x
The graph.
i
Index, integer, character or logical, see details below.
j
Index, integer, character or logical, see details below.
from
A numeric or character vector giving vertex ids or names. Together with the to argument, it can be used to query/set a sequence of edges. See details below. This argument cannot be present together with any of the i and j
 to A numeric or character vector giving vertex ids or names. Together with the from argument, it can be used to query/set a sequence of edges. See details below. This argument cannot be present together with any of the i and j ... Additional arguments are not used currently. directed Logical scalar, whether to consider edge directions in directed graphs. It is ignored for undirected graphs. edges Logical scalar, whether to return edge ids. exact Ignored. 
 
 Details The double bracket operator indexes the (imaginary) adjacency list of the graph. This can used for the following operations: Querying the adjacent vertices for one or more vertices:graph[[1:3,]] graph[[,1:3]]The first form gives the successors, the second the predessors or the 1:3 vertices. (For undirected graphs they are equivalent.)Querying the incident edges for one or more vertices, if theedgesargument is set toTRUE:graph[[1:3, , edges=TRUE]] graph[[, 1:3, edges=TRUE]]Querying the edge ids between two sets or vertices, if both indices are used. E.g.graph[[v, w, edges=TRUE]]gives the edge ids of all the edges that exist from vertices$v$to vertices$w$.The alternative argument names from and to can be used instead of the usual i and j, to make the code more readable: graph[[from = 1:3]] graph[[from = v, to = w, edges = TRUE]][[ operators allows logical indices and negative indices as well, with the usual R semantics.Vertex names are also supported, so instead of a numeric vertex id a vertex can also be given to [ and [[. See Also Other structural queries: [.igraph; adjacent_vertices; are.connected, are_adjacent; ecount, gsize; ends, get.edge, get.edges; get.edge.ids; gorder, vcount; head_of; incident_edges; incident; is.directed, is_directed; neighbors; tail_of Aliases [[.igraph Documentation reproduced from package igraph, version 1.0.0, License: GPL (>= 2) Community examples Looks like there are no examples yet. Post a new example: 
 
 
 R package Rdocumentation.org Created by DataCamp.com 
 Put your R skills to the test MathJax.Hub.Config({ messageStyle: "none", jax: ["input/TeX","output/CommonHTML"], extensions: ["tex2jax.js","MathMenu.js","MathZoom.js"], TeX: { extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"] }, tex2jax: { inlineMath: [ ['$','$'], ['\$','\$'] ], displayMath: [ ['$$','$$'] ], processEscapes: true, preview: 'none' } }); var $jq = jQuery.noConflict(); ;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[]; p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments) };p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1; n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//cdn.datacamp.com/sp/2.10.2.js","snowplow")); var options = { appId: 'rdocumentation', platform: 'web', post: true, discoverRootDomain: true, contexts: { webPage: true, performanceTiming: true } }; options.forceSecureTracker = true; options.postPath = '/spevent'; window.snowplow('newTracker', 'co', "www.datacamp.com", options); window.snowplow('enableActivityTracking', 10, 10); // Ping every 10 seconds after 10 seconds window.snowplow('enableLinkClickTracking'); window.snowplow('trackPageView', null, [ { schema: 'iglu:com.datacamp/user/jsonschema/1-0-0', data: { anonId:$jq.cookie('dc_aid'), } } ]); var config = { forms: { whitelist: ["snowplow_tracked"] }, fields: { blacklist: ['password', 'password_confirmation'] } }; window.snowplow('enableFormTracking', config); (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-41577880-1', 'rdocumentation.org'); ga('send', 'pageview');