[R] ggplot - class "character" problem

Ista Zahn izahn at psych.rochester.edu
Tue Sep 13 15:08:09 CEST 2011


On Tue, Sep 13, 2011 at 7:32 AM, RCulloch <ross.culloch at dur.ac.uk> wrote:
> I suspect it is to do with your method of creating the dataframe,

I think the error is actually triggered by quoting the name of the
data.frame in the qplot call.

I would
> check to see if the columns in the df are numeric, which you can do by:
>
> is.numeric(flat_data$time)

Or just use str(flat_data)

Best,
Ista

>
> for each variable, if it is not numeric (and at least one must be a
> character, given the error message) then redefine as a numeric
>
> flat_data$time<-as.numeric(flat_data$time)
>
> I reckon people better versed in R will have a more efficient solution, but
> that should work......
>
> Ross
>
> --
> View this message in context: http://r.789695.n4.nabble.com/ggplot-class-character-problem-tp3809657p3809786.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>



-- 
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org



More information about the R-help mailing list