← Back to R Course | Chapter 10: Data Visualization | Lesson 4 of 7

boxplot() का उपयोग

एक boxplot numbers के एक set का middle, spread, और oddballs एक छोटी picture में दिखाता है। यह एक group के scores कैसे दिखते हैं इसकी एक quick photo जैसा है।

In this page:

  1. boxplot()
Syntax
r
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()

markup
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")
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. #}
आम गलतियां
  1. non-numeric columns वाली एक पूरी data frame pass करना, जब boxplot() को numeric data या एक formula चाहिए।
  2. whiskers से आगे dots को errors की तरह treat करना, जब वे marked outliers हैं।
  3. boxplot(y ~ group) को गलत order में इस्तेमाल करना, जैसे group ~ y, इसलिए plot गलत है।
🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.