R Max and Min

🔼🔽 R Max and Min
These are commonly used in statistics, data analysis, and reporting.
1. max() – Find Maximum Value
Output:
2. min() – Find Minimum Value
Output:
3. Max & Min Together
Output:
📌 range() returns min first, then max
4. Max & Min with Missing Values (NA)
By default, NA gives NA result.
❌ Output:
✅ Correct way:
5. Max & Min in Data Frames
6. Row-wise and Column-wise Max/Min
7. Index of Max & Min Values
✔ Returns position (index) of max/min value
8. Logical Use Case Example
📌 Summary
max()→ largest valuemin()→ smallest valuerange()→ min & max togetherUse
na.rm = TRUEto ignore missing valueswhich.max()/which.min()give position
