Having trouble viewing more than 10 rows in a tibble

后端 未结 3 2149
-上瘾入骨i
-上瘾入骨i 2021-01-04 05:02

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

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-04 06:08

    If you want to stay in the console, then note that tibbles have print S3 methods defined so you can use options such as (see ?print.tbl):

    very_long <- as_tibble(seq(1:1000))
    print(very_long, n = 3)
    # A tibble: 1,000 x 1
      value
      
    1     1
    2     2
    3     3
    # ... with 997 more rows
    

    Note, tail doesn't play with tibbles, so if you want to combine tail with tibbles to look at the end of your data, then you have to do something like:

    print(tail(very_long, n = 3), n = 3)
    # A tibble: 3 x 1
      value
      
    1   998
    2   999
    3  1000
    

提交回复
热议问题