I have a dataframes with a column called Means. I want to get just the first quartile from this column. I know I can use quartile (df) or summary (df) but this gives me all the quartiles. How do I get just the first?
Take the median of the lower half of the data set. The median of this set is the value of the first quartile.
You could try this:
#sample data
Means <- runif(100)
#and this is how you get the first quartile
> summary(Means)[2]
1st Qu.
0.2325
Or using function quantile
as per Pascal's comment:
> quantile(Means, 0.25)
25%
0.2324663
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With