當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


R panel.densityplot 密度圖的默認麵板函數

R語言 panel.densityplot 位於 lattice 包(package)。

說明

這是densityplot 的默認麵板函數。

用法

panel.densityplot(x, darg, plot.points = "jitter",
                  ref = FALSE,
                  groups = NULL,
                  weights = NULL,
                  jitter.amount,
                  type, ...,
                  grid = lattice.getOption("default.args")$grid,
                  identifier = "density")

參數

x

要估計密度的數據點

darg

要傳遞給 density 函數的參數列表。通常,這應該是包含零個或多個以下組件的列表:bw , adjust , kernel , window , width , give.Rkern , n , from , to , cut , na.rm(有關詳細信息,請參閱density)

plot.points

邏輯指定數據點是否應與估計密度一起繪製。或者,指定如何繪製點的字符串。有意義的值是 "rug" ,在這種情況下 panel.rug 用於繪製 ‘rug’ 和 "jitter" ,在這種情況下,點垂直抖動以更好地區分重疊點。

ref

邏輯,是否繪製x軸

groups

可選的分組變量。如果存在,將使用panel.superpose來顯示每個子組

weights

用於密度計算的權重數值向量。如果指定了此項,則 ... 部分還必須包含與 x 的權重匹配的 subscripts 參數。

jitter.amount

plot.points="jitter" 時,用作 jitteramount 參數的值。

type

如果需要,type 參數用於繪製點。這預計不會有用,它主要用於保護type 參數(如果指定)影響密度曲線。

...

額外的圖形參數。請注意,panel.rug 的附加參數不能通過 panel.densityplot 傳遞。

grid

邏輯標誌、字符串或列表,指定是否以及如何繪製背景網格。在其一般形式中, grid 可以是要提供給 panel.grid 的參數列表,並使用這些參數來調用 panel.grid 。可以使用三個快捷方式:

TRUE

大致相當於list(h = -1, v = -1)

"h"

大致相當於list(h = -1, v = 0)

"v"

大致相當於list(h = 0, v = -1)

如果 grid = FALSE 則不會繪製網格。

identifier

附加到由此麵板函數創建的 grobs 名稱之前的字符串。

作者

Deepayan Sarkar Deepayan.Sarkar@R-project.org

也可以看看

densityplot , jitter

相關用法


注:本文由純淨天空篩選整理自R-devel大神的英文原創作品 Default Panel Function for densityplot。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。