[R] run self written functions

From: Antje <niederlein-rstat_at_yahoo.de>
Date: Thu 03 Aug 2006 - 17:36:58 EST


Hello,

I'm not sure if I'm in the right place with my question... I'm running R on Windows and wrote a function and saved it as .R file. It looks like this:

bmi <- function(weight, height) {

    bmi <- weight / height^2
    bmi
}

If I want to use this function, I have to mark everything and then press Ctrl-R. But then everything single line is executed on the command line, which means that I will "loose" my history when the code becomes longer. Further, I wonder if there is any way to do some output for control within the function (or any other possibilities to debug in a way).

Maybe, I have chosen a completely wrong way? I only want to make it easy to create some graphical visualizations of data which will be read in by csv. files, has to be converted and then displayed depending on some "displaying parameters".

Ciao,
Antje



R-help@stat.math.ethz.ch 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. Received on Thu Aug 03 17:43:05 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 04 Aug 2006 - 02:18:08 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.