I have to calculate a quartiles for given values and calculated the quartiles using quartile() function in R like below
vc <- c(1,2,5,6,7,9,12,15,18,19,27)
quartiles <- quantile(vc, probs = seq(0,1,0.01))
The output from above code is
0% 1.0
1% 1.1
2% 1.2
3% 1.3
4% 1.5
.... and so on upto 100%. //this output is named vector
I want to convert this output named vector to data frame with columns 'quartile' and 'pvalues' like below
quartile pvalues
0 1.0
1 1.1
2 1.2
3 1.3
4 1.4
.... so on upto 100.
I want to convert 0%, 1% ... values as a integer in quartile column and vectors values to pvalues column.