-1

Take the following example from CRAN'S dplyr introduction:

select(flights, tail_num = tailnum)
 #> # A tibble: 336,776 x 1
 #>   tail_num
 #>      <chr>
 #> 1   N14228
 #> 2   N24211
 #> 3   N619AA
 #> 4   N804JB
 #> ... with 336,772 more rows

Why are these row ids being returned and is there anyway to remove them?

HubertL
  • 19,246
  • 3
  • 32
  • 51
Joseph
  • 327
  • 5
  • 17

1 Answers1

2

These ids are only lines number that are actually not stored. They are only here for display purposes and they are not real Ids

Loay Ashmawy
  • 677
  • 1
  • 7
  • 26
  • Understood. But is there anyway to remove them – Joseph Mar 14 '17 at 19:24
  • 1
    @Joseph Well, if you just want the vector... `select(flights, tail_num = tailnum) %>% c`. Otherwise maybe you want http://stackoverflow.com/a/36706785/ – Frank Mar 14 '17 at 19:30
  • 1
    You should do what @Frank said to use the vector. Otherwise these values can't be removed because they don't exist anywhere in the memory, in other words there are no variables representing these values! – Loay Ashmawy Mar 14 '17 at 19:39
  • Won't these come up in shiny dashboard? – Joseph Mar 14 '17 at 20:00
  • I don't really know I've never used it. If you really want to print your elements without the line number you can do a **for loop** and print each element individually. – Loay Ashmawy Mar 15 '17 at 09:02