boxplot() का उपयोग
एक boxplot numbers के एक set का middle, spread, और oddballs एक छोटी picture में दिखाता है। यह एक group के scores कैसे दिखते हैं इसकी एक quick photo जैसा है।
In this page:
Syntax
boxplot(x, main = "title")
boxplot(value ~ group, data = df)
boxplot()
boxplot(x) एक numeric vector की distribution को इसके quartiles, median, और outliers के जरिए visually summarize करता है, summary() जैसा ही five-number summary इस्तेमाल करते हुए।
यह कई groups के आर-पार side by side distributions compare करने के लिए खासकर useful है, जैसे boxplot(value ~ group, data = df)। Boxplots outliers को plot के whiskers से आगे points की तरह तुरंत visible बनाते हैं।
Note:
boxplot(value ~ group, data = df) प्रति group एक box draw करता है, distributions side by side compare करना आसान बनाते हुए।
उदाहरण: boxplot()
set.seed(1)
values <- c(rnorm(20, mean = 50), 150) # includes an outlier
print(summary(values))
cat("boxplot(values) would show the outlier at 150 clearly beyond the whiskers\n")
Login to try C/C++/Java/PHP code in the editor
Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the
view already swaps in the hi_ translation fields (or blanks these
out if untranslated), so this renders correctly for both languages
without a lang_code check here. #}
आम गलतियां
- non-numeric columns वाली एक पूरी data frame pass करना, जब
boxplot()को numeric data या एक formula चाहिए। - whiskers से आगे dots को errors की तरह treat करना, जब वे marked outliers हैं।
boxplot(y ~ group)को गलत order में इस्तेमाल करना, जैसेgroup ~ y, इसलिए plot गलत है।
🔒
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: