re-write plot function for ggplot

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

re-write plot function for ggplot

rmje
Hi, I have the following function that i use to plot graphs.

plot_mi_time = function(mdata, miname) {
   mdata2 = mdata[row.names(mir_test3) == miname, ]
   # print(mdata2)
   xcoords <- c(1,1,2,2,3,3)
   plot(xcoords, mdata2, xaxt="n", ylab="Expression", xlab="Time(h)", , main=miname)
           axis(1, at=xcoords, labels=c("a","a","b","b","c","c"))
}




I want to edit this function so that i can plot it using ggplot.
Any suggestions on how to re-write it?
Reply | Threaded
Open this post in threaded view
|

Re: re-write plot function for ggplot

Lamke
You should post it on the ggplot2 mailing list.  For the long run I would suggest getting the book as it's extremely helpful.
Reply | Threaded
Open this post in threaded view
|

Re: re-write plot function for ggplot

John Ramey
In reply to this post by rmje
A useful way to get a feel for ggplot2 is to check out
http://yeroon.net/ggplot2/

This site allows for a point-and-click ggplot2 graphs. You will not
have all of the options from ggplot2 (e.g. themes), but it's a good
place to get started.

Also, there are some wonderful video tutorials in the help section.

Cheers!

--
John A. Ramey, M.S.
Ph.D. Candidate
Department of Statistics
Baylor University
http://www.johnramey.net



On Wed, Jun 1, 2011 at 6:43 AM, rmje <[hidden email]> wrote:

> Hi, I have the following function that i use to plot graphs.
>
> plot_mi_time = function(mdata, miname) {
>   mdata2 = mdata[row.names(mir_test3) == miname, ]
>   # print(mdata2)
>   xcoords <- c(1,1,2,2,3,3)
>   plot(xcoords, mdata2, xaxt="n", ylab="Expression", xlab="Time(h)", ,
> main=miname)
>           axis(1, at=xcoords, labels=c("a","a","b","b","c","c"))
> }
>
>
>
>
> I want to edit this function so that i can plot it using ggplot.
> Any suggestions on how to re-write it?
>
> --
> View this message in context: http://r.789695.n4.nabble.com/re-write-plot-function-for-ggplot-tp3565868p3565868.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] 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.
>



--
John A. Ramey, M.S.
Ph.D. Candidate
Department of Statistics
Baylor University
http://www.johnramey.net

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: re-write plot function for ggplot

rmje
I have been browsing the pages about ggplot and it really doesn't deal with such problems as far as I can see.

Reply | Threaded
Open this post in threaded view
|

Re: re-write plot function for ggplot

Hadley Wickham-2
Doesn't deal with what problems?
Hadley

On Thursday, June 2, 2011, rmje <[hidden email]> wrote:

> I have been browsing the pages about ggplot and it really doesn't deal with
> such problems as far as I can see.
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/re-write-plot-function-for-ggplot-tp3565868p3568025.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] 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.
>

--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/

______________________________________________
[hidden email] 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.