[R] quantile() and "factors not allowed"

Joshua Wiley jwiley.psych at gmail.com
Wed Sep 29 03:07:12 CEST 2010


Hi Steve,

The basic problem (as the error suggests) is that data of class
"factor" is not allowed in quantile.default.  So one of the elements
of your list must be a factor.  What are the results of:   str(t)  ?
As a side note, since t() is a function, using t as a variable name
can be a bit confusing.

If your list is relative small, you could post the results of dput(t)
which would allow us to see what your data is actually like and
perhaps identify the exact problem and offer a solution.

Cheers,

Josh


On Tue, Sep 28, 2010 at 5:56 PM, Steve <null at ittibitti.org> wrote:
> A list (t) that I'm trying to pass to quantile() is causing this error:
>
> Error in  quantile.default(t, probs = c(0.9, 9.95, 0.99))
>  factors are not allowed
>
> I've successfully use lists before, and am having difficulty finding my
> mistake.  Any suggestions appreciated!
>
> -Steve
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/



More information about the R-help mailing list