Re: [R] custom function that plots other functions- problem

2013-05-05 Thread Jeff Newmiller
This request is clearly off-topic according to the Posting Guide. Please use the study assistance provided in the context of your assignment. --- Jeff NewmillerThe . . Go Live... DCN:

Re: [R] custom function that plots other functions- problem

2013-05-05 Thread Rui Barradas
Hello, Try the following. Note that argument 'how_many' is not needed, it can be derived from the length of the functions vector. plotter<- function(f, range, quality){ x <- seq(range[1], range[2], quality) y <- sapply(seq_along(f), function(.i) f[[.i]](x)) plot(x, y[, 1]) fo

[R] custom function that plots other functions- problem

2013-05-05 Thread Bartłomiej Drążczyk
Hi everyone! Could you please help me with the following assignment? My aim is to write a custom function that draws the plots of functions submitted by the user. The catch is, that we do not know the exact number of functions the user will select to draw. The program is relatively easy with one