Hmisc describe 輸出
與 psych 套件類似,Hmisc 套件會建立客製化的輸出。str() 函式會顯示客製化的類別型別,以及 Hmisc::describe() 所回傳 list 輸出內各元素的名稱。
由於輸出是 list,你可以使用 $ 選擇器運算子,從 Hmisc::describe() 的輸出物件中擷取特定元素。
abaloneKeep 資料集與 dplyr、Hmisc 套件都已為你載入。
本練習屬於課程
給 SAS 使用者的 R
練習說明
- 使用
Hmisc::describe()對 abalone 的 whole weight、shucked weight 與 shell weight 產生輸出,並將結果儲存為abhmisc。 - 顯示
abhmisc的結構。 - 顯示
abhmisc輸出物件中的shuckedWeight元素。 - 顯示
abhmisc輸出物件中shuckedWeight元素的extremes子元素。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Save output from Hmisc::describe(), view class of output
abhmisc <- ___ %>%
___ %>%
___
# Get structure of abhmisc
___
# View shuckedWeight statistics from abhmisc
___
# View shuckedWeight extremes from abhmisc
___