# How to hide outliers in base R boxplot?

R ProgrammingServer Side ProgrammingProgramming

#### Artificial Intelligence : The Future Of Programming

15 Lectures 54 mins

#### Beyond Basic Programming - Intermediate Python

Most Popular

36 Lectures 3 hours

#### C Programming from scratch- Master C Programming

Best Seller

60 Lectures 8 hours

To hide outliers in base R boxplot, we can use range argument inside boxplot function but we will have to play with range argument. The range argument can take many values therefore, we would need to find the correct one that removes all the outliers. To understand how it works check out the Example given below −

## Example

To hide outliners in base R boxplot, use the following snippet −

x<-c(-10,rpois(10,5),20)
boxplot(x)

## Output

If you execute the above given snippet, it generates the following Output −

To hide outliners in base R boxplot, add the following code to the above snippet −

x<-c(-10,rpois(10,5),20)
boxplot(x,range=4)

## Output

If you execute all the above given snippets as a single program, it generates the following Output −

Updated on 05-Nov-2021 06:54:45