開始使用免費開始

Hmisc describe 輸出

psych 套件類似,Hmisc 套件會建立客製化的輸出。str() 函式會顯示客製化的類別型別,以及 Hmisc::describe() 所回傳 list 輸出內各元素的名稱。

由於輸出是 list,你可以使用 $ 選擇器運算子,從 Hmisc::describe() 的輸出物件中擷取特定元素。

abaloneKeep 資料集與 dplyrHmisc 套件都已為你載入。

本練習屬於課程

給 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
___
編輯並執行程式碼