I am probably making some easy mistake here but I have a matrix, and I want to produce the quantiles of the whole matrix. I've tried this:
quantile(unlist(ricepm), probs = c(.25, .5, .75))
but this gives me the wrong output (all 1's)
25% 50% 75%
1 1 1
A dput(head(ricepm[, c(5, 5)]))
sample of my data
structure(
list(
Antigua.and.Barbuda =
structure(c(1L, 1L, 1L, 1L, 1L, 24L),
.Label =
c("0", "0,001255087", "0,001351049", "0,002179536",
"0,002322295", "0,00352192", "0,003639649", "0,005203948", "0,005613623",
"0,005899437", "0,0063163", "0,008692968", "0,010768326", "0,01815333",
"0,022817923", "0,05455008", "0,076043772", "0,761972864", "1,167911482",
"11,39171454", "17,55057703", "2,827338354", "3,180646314", "3,18612071",
"3,519189594", "376,5666716", "4,22468796", "5,861801198", "572,3941286",
"76,13680349"
),
class = "factor"
),
Antigua.and.Barbuda.1 =
structure(
c(1L, 1L, 1L, 1L, 1L, 24L),
.Label =
c("0", "0,001255087", "0,001351049",
"0,002179536", "0,002322295", "0,00352192", "0,003639649", "0,005203948",
"0,005613623", "0,005899437", "0,0063163", "0,008692968", "0,010768326",
"0,01815333", "0,022817923", "0,05455008", "0,076043772", "0,761972864",
"1,167911482", "11,39171454", "17,55057703", "2,827338354", "3,180646314",
"3,18612071", "3,519189594", "376,5666716", "4,22468796", "5,861801198",
"572,3941286", "76,13680349"
),
class = "factor"
)
),
row.names =
c("Afghanistan","Albania", "Algeria", "Angola", "Antigua and Barbuda", "Argentina"),
class = "data.frame"
)