Re: [R] ggplot inside of the function

2019-11-25 Thread Thevaraja, Mayooran
Great it works. Thank you so much Eric. Cheers, Mayooran -Original Message- From: Eric Berger Sent: Monday, 25 November 2019 11:22 PM To: Thevaraja, Mayooran Cc: r-help Subject: Re: [R] ggplot inside of the function Hi Mayooran, If you define the following function f <- functio

Re: [R] ggplot inside of the function

2019-11-25 Thread Eric Berger
Hi Mayooran, If you define the following function f <- function(m,v) { sprintf("Norm(mu=%.1f, var=%.1f)",m,v) } Then you can modify the setting of Prob as follows Prob <- plyr::rename(Prob_df, c("p_1"=f(mu1,var1),"p_2"=f(mu2,var2),"p_3"=f(mu3,var3))) The lesson here is that wherever you set a

[R] ggplot inside of the function

2019-11-24 Thread Thevaraja, Mayooran
Hello Folks I am working some R package development. When I was using ggplot inside of the function, I need to get the output graph's legend must be corresponding to the input parameters numerical value (need to be automatically changed when we input different parameters). Theref