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

hist() का उपयोग

एक histogram numbers को ranges में group करता है और draw करता है कितने हर एक में आते हैं, height groups से blocks stack करने की तरह। यह आपके data का shape दिखाता है।

In this page:

  1. hist()
Syntax
r
hist(x, breaks = number_of_bins, main = "title", xlab = "label")

hist()

hist(x) एक numeric vector की frequency distribution दिखाने वाला एक histogram draw करता है, automatically sensible bin widths चुनते हुए (या एक explicit breaks argument accept करते हुए)।

यह visually एक dataset की distribution shape inspect करने के सबसे fast तरीकों में से एक है। Histograms किसी भी numeric variable के लिए exploratory data analysis में पहला step हैं।

Note: hist() को breaks = n pass करें यह control करने के लिए कि histogram लगभग कितने bins इस्तेमाल करे।

उदाहरण: hist()

markup
set.seed(1)
values <- rnorm(100, mean = 50, sd = 10)

cat("Summary of values that hist() would visualize:\n")
print(summary(values))
cat("hist(values) would draw a histogram of this distribution\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. एक data frame या एक character vector pass करना, जो x must be numeric देता है।
  2. bars की संख्या को data की तरह पढ़ना, जब यह breaks setting पर depend करता है और shape hide कर सकता है।
  3. hist() को barplot() से confuse करना, जब एक histogram एक numeric range को bins में group करता है।
🔒

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.