[R] Override/Insert (Change) a value (default value) inside a function

Mohammad Tanvir Ahamed mashranga at yahoo.com
Sat Mar 11 22:26:47 CET 2017


Hi!, 

Lets I have a function form a package. 
The function is,  as an example, 

myplot <- function(x,y) { plot(x,y) }


Now I can use the function according to function's defined argument. 

x<- sort(runif(200))
y<- 1:200
myplot(x,y)

Now I want to input extra argument or override default value of plot inside the function myplot. 

If I use  myplot (x,y, col = "red", cex = 0.1 )  it does not work . I clearly understand , why it does not work . 
But in this situation how can i solve the problem ? 

I will be grateful if any one can help. 
Thanks in advance !!
 
Tanvir Ahamed 
Göteborg, Sweden  |  mashranga at yahoo.com 



More information about the R-help mailing list