# median x <-c(10,12,14,16,18,20,22) f <-c(2,5,12,20,10,7,3) N <-print(sum(f)) lcf <-print(cumsum(f)) df <-print(data.frame(x,f,lcf)) median_index <-print(which(lcf>=N/2)[1]) median <-print(x[median_index])
To embed this project on your website, copy the following code and paste it into your website's HTML: