Skip to content

Commit

Permalink
Correct calculation of mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nimarafati committed Oct 28, 2024
1 parent 95295fe commit caf62b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions slide_r_basic_statistic.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,10 @@ text(x = var2_mode - 90 , y = 600, labels = paste("Mode =", round(var2_mode, 2))
```

```{r mode, echoo = T, eval = T}
mode(data$var1)
mode(data$var2)
density_data1 <- density(data$var1)
density_data1$x[which.max(density_data1$y)]
density_data2 <- density(data$var2)
density_data2$x[which.max(density_data2$y)]
```
---
name: Spread
Expand Down

0 comments on commit caf62b3

Please sign in to comment.