title: `E<-`(`*tmp*`, value = `*vtmp*`) : invalid indexing, building a subset of an OSM Object. Edit: subset does not create a true subset
body: <p>Im trying to build a small subset of a bigger osm object:</p>
  <p>First i load a bigger osm object into memory:</p>
  <pre><code>muc_bbox &lt;- center_bbox(mid_point[1], mid_point[2], dist * 2, dist * 2)
  src &lt;- osmsource_osmosis(file = paste(maps_pfad,&quot;streets_bayern.osm&quot;,sep = &quot;&quot;))
  muc &lt;- get_osm(muc_bbox, src)
  </code></pre>
  <p>then i build a subset based on coordinates of the nodes:</p>
  <pre><code>subset_bbox &lt;- center_bbox(mid_point[1], mid_point[2], dist, dist)
  </code></pre>
  <p>maybe i have to use find instead of subset here?</p>
  <pre><code>muc_subset_df &lt;- subset(muc$nodes$attrs, lon &gt; subset_bbox[[1]] &amp; lon &lt; subset_bbox[[3]] 
  &amp;lat &gt; subset_bbox[[2]] &amp; lat &lt; subset_bbox[[4]])
  
  subset_ids &lt;- muc_subset_df$id
  muc_subset &lt;- subset(muc, node_ids = subset_ids)
  
  muc &lt;- muc_subset
  </code></pre>
  <p>so basically i search for all the node ids of nodes that are in the lat&amp;lon value range of bbox.</p>
  <p>now i want to build n igraph of this new subset:</p>
  <pre><code>gr_muc &lt;- as_igraph(muc)
  </code></pre>
  <p>And get this error:</p>
  <pre><code>E&lt;-`(`*tmp*`, value = `*vtmp*`) : invalid indexing
  </code></pre>
  <p>What is the mistake im making?</p>
  <p>Before i subset i get this info regarding muc object</p>
  <pre><code>    dim(muc)
      nodes      ways relations 
     360451     59490         3 
  </code></pre>
  <p>After Subset i get 0 ways and relations.
  I think this is probably the mistake... how would i subset everything?</p>
  <p>Even after i use <code>find_up</code> function on <code>subset_ids</code> i still dont get any <code>relation_ids</code>.</p>
  <pre><code>subset_ids &lt;- muc_subset_df$id
  osm_subset_ids &lt;- find_up(muc, node(subset_ids))
  muc_subset &lt;- subset(muc,  osm_subset_ids)
  </code></pre>
  <p>What am i missing?</p>
  <p>EDIT:
  After investigating a bit further it seems that</p>
  <pre><code>muc_subset &lt;- subset(muc,  osm_subset_ids)
  </code></pre>
  <p>Does not create a true subset of an osm object.
  It only creates an object containing nodes but no ways or relations.
  I suspect this to be a problem but still dont know how to solve it.</p>
  <pre><code>&gt; muc_subset
  osmar object
  80165 nodes, 0 ways, 0 relations 
  &gt; muc
  osmar object
  80165 nodes, 14161 ways, 0 relations 
  </code></pre>
  <p>Yet <code>osm_subset_ids</code> contains ids of ways.</p>
  <p>Best regards,
  Andreas.</p>