簡體   English   中英

我如何使數據集顯示在 head() function 上以清楚地顯示所有列

[英]How do i make the dataset displayed on the head() function to show all the columns clearly

我使用 head() function 來顯示我的數據集的前六行,但它沒有清楚地顯示所有列名。 這是它的顯示方式:

head(activity)
# A tibble: 6 × 15
          Id Activ…¹ Total…² Total…³ Track…⁴ Logge…⁵ VeryA…⁶ Moder…⁷ Light…⁸ Seden…⁹
       <dbl> <chr>     <dbl>   <dbl>   <dbl>   <dbl>   <dbl>   <dbl>   <dbl>   <dbl>
1 1503960366 4/12/2…   13162    8.5     8.5        0    1.88   0.550    6.06       0
2 1503960366 4/13/2…   10735    6.97    6.97       0    1.57   0.690    4.71       0
3 1503960366 4/14/2…   10460    6.74    6.74       0    2.44   0.400    3.91       0
4 1503960366 4/15/2…    9762    6.28    6.28       0    2.14   1.26     2.83       0
5 1503960366 4/16/2…   12669    8.16    8.16       0    2.71   0.410    5.04       0
6 1503960366 4/17/2…    9705    6.48    6.48       0    3.19   0.780    2.51       0

我看到有人在 kaggle 上工作,她自己的數據集使用 head() function 以這種方式出現

A data.frame: 6 × 15
Id  ActivityDate    TotalSteps  TotalDistance   TrackerDistance LoggedActivitiesDistance    VeryActiveDistance  ModeratelyActiveDistance    LightActiveDistance SedentaryActiveDistance VeryActiveMinutes   FairlyActiveMinutes LightlyActiveMinutes    SedentaryMinutes    Calories
<dbl>   <fct>   <int>   <dbl>   <dbl>   <dbl>   <dbl>   <dbl>   <dbl>   <dbl>   <int>   <int>   <int>   <int>   <int>
1   1503960366  4/12/2016   13162   8.50    8.50    0   1.88    0.55    6.06    0   25  13  328 728 1985
2   1503960366  4/13/2016   10735   6.97    6.97    0   1.57    0.69    4.71    0   21  19  217 776 1797
3   1503960366  4/14/2016   10460   6.74    6.74    0   2.44    0.40    3.91    0   30  11  181 1218    1776
4   1503960366  4/15/2016   9762    6.28    6.28    0   2.14    1.26    2.83    0   29  34  209 726 1745
5   1503960366  4/16/2016   12669   8.16    8.16    0   2.71    0.41    5.04    0   36  10  221 773 1863
6   1503960366  4/17/2016   9705    6.48    6.48    0

請問我如何讓我清楚地顯示所有列。

您正在顯示tibble() ,它僅顯示前十行和適合一個屏幕的所有列。 您可以使用選項控制默認外觀。

您是否嘗試過options(pillar.width = Inf)

請參閱?pillar::pillar_options?tibble_options了解可用選項

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM