Having trouble viewing more than 10 rows in a tibble

Meraj Shah picture Meraj Shah · Mar 6, 2018 · Viewed 12.4k times · Source

First off - I am a beginner at programming and R, so excuse me if this is a silly question. I am having trouble viewing more than ten rows in a tibble that is generated from the following code.

The code below is meant to find the most common words in a book. I am getting the results I want, but how do I view more than 10 rows of data. To my knowledge, it is not being saved as a data frame that I can call.

library(dplyr)
tidy_books %>%
    anti_join(stop_words) %>%
    count(word, sort=TRUE)
Joining, by = "word"
# A tibble: 3,397 x 2
   word       n
   <chr>  <int>
 1 alice    820
 2 queen    247
 3 time     141
 4 king     122
 5 head     112
 6 looked   100
 7 white     97
 8 round     96
 9 voice     86
10 tone      81
# ... with 3,387 more rows

Answer

Magma picture Magma · Feb 21, 2019

Although this question has a perfectly ok answer, the comment from @Marius is much shorter, so:

tidy_books %>% print(n = 100)

As you say you are a beginner you can replace n = 100 with any number you want

Also as you are a beginner, to see the whole table:

tidy_books %>% print(n = nrow(tidy_books))