[R] Plot

Tyler Rinker tyler_rinker at hotmail.com
Mon May 14 22:41:14 CEST 2012


I noticed I was remiss in addressing your origin question:
Use the xlim and ylim, setting the lower limit to 0.  Here's an example of this with the CO2 dataset:


plot(uptake~Plant, data=CO2)


plot(uptake~as.numeric(Plant), data=CO2)


plot(uptake~as.numeric(Plant), data=CO2, ylim=c(0, 50), xlim=c(0, 14))



Cheers,Tyler
----------------------------------------
> From: tyler_rinker at hotmail.com
> To: kellycool79 at yahoo.com; r-help at r-project.org
> Date: Mon, 14 May 2012 16:31:26 -0400
> Subject: Re: [R] Plot
>
>
>
> That is likely because ferm is a factor.  A scatterplot is two numeric variables.  To make it a scatterplot wrap ferm with as.numeric.
> Cheers,
> Tyler
> ----------------------------------------
> Date: Mon, 14 May 2012 12:21:12 -0700
> From: kellycool79 at yahoo.com
> To: r-help at r-project.org
> Subject: [R] Plot
>
>
> Hello,
>
> I am trying to make a plot of the rates of an enzyme against three different protein concentrations (there are 45 rates in total and split up into 3 groups of 15, each receiving one of the 3 protein concentrations). When I enter the following code I instead get 3 separate boxplots for each of the three different protein concentrations ...
>
>
> plot(rate ~ ferm, data=LDH, col=LDH$rate, pch=c(17,18,19)[(as.numeric(LDH$rate)%%3)+1])
>
>
> but I want a scatterplot showing 3 different lines indicating each of the protein concentrations. I'm not sure if I need to tweak my data set in order to get what I want?
>
> I was also wondering how to include the origin (0,0) in the plots. I'm not sure if I'm missing something on the plot help page?
>
> Any help would be appreciated. Thanks so much.
> [[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.
>
> ______________________________________________
> 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