[R] RES: Plot

Rodrigo Aluizio r.aluizio at gmail.com
Tue Oct 6 16:56:42 CEST 2009


This may work for you.
Then you can custom your graphics with ?par.

Data<-as.data.frame(matrix(c("Monday", "Tuesday", "Wed", "Thu", "Fri",
"Sat","Sun",56,57,60,75,62,67,70,76,77,81,95,82,77,83),ncol=3,nrow=7,list(pa
ste('Row',1:7,sep=''),c('Days','Hum','Temp')),byrow=F))

plot(Data$Days,Data$Temp)

-----Mensagem original-----
De: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Em
nome de Ashta
Enviada em: terça-feira, 6 de outubro de 2009 11:36
Para: Sarah Goslee
Cc: R help
Assunto: Re: [R] Plot

Thanks Sara,

Yes I did try. I could not get the Days on the X-axis

blow is theerror message

plot(Temp,Days)
Error in plot.window(...) : need finite 'ylim' values
In addition: Warning messages:
1: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion
2: In min(x) : no non-missing arguments to min; returning Inf
3: In max(x) : no non-missing arguments to max; returning -Inf
>



On Tue, Oct 6, 2009 at 10:19 AM, Sarah Goslee <sarah.goslee at gmail.com>wrote:

> Did you try it? With, perhaps, plot() ? And lines() ?
>
> You might do better with Days as a factor with the day names in order.
(And
> why are two full and five abbreviated?)
>
> I don't understand why Hum and Temp are matrices rather than vectors,
> and why then you didn't specify dimensions, and for that matter why you
> are missing a closing paren but do have a comma in its place.
>
> Generally this list is happy to help, but we like some evidence that the
> querent has *tried* before inquiring.
>
> Sarah
>
> On Tue, Oct 6, 2009 at 10:05 AM, Ashta <sewashm at gmail.com> wrote:
> > Hi All,
> >
> >
> > Days <- matrix(c("Monday", "Tuesday", "Wed", "Thu", "Fri", "Sat",
> > "Sun"),7,1)
> >
> > Hum <-matrix(c(56,57,60,75,62,67,70),
> >
> > Temp<-matrix(c(76,77,81,95,82,77,83),
> >
> >
> >
> > Using the above information I want plot humidity and temperature on
> Y-axis
> > and days on X-axis
> >
> > Any help is appreciated!
> >
>
> --
> Sarah Goslee
> http://www.functionaldiversity.org
>

	[[alternative HTML version deleted]]

______________________________________________
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.




More information about the R-help mailing list