Hi,

I'm trying to make a function which does a lot of computational work and visualization work.
This won't be a problem, but as things can get a lot of computational time, I would like to print what is going on, but also instructions about what the user should do.

A small example:

fctn <- function(data.df){
    cat("Calculating linear regression \n")
    data.lm <- lm(y~x,data.df)
    cat("Calculating ANOVA \n")
    data.aov<- aov(data.lm)
    cat("Plotting graphs \n")
    plot(y~x, data.df)
    cat("Click on the graph to set X and Y limits \n")}
    lim <- locator(n=2)
    plot(y~x,data.df,ylim=sort(lim$y),xlim=sort(lim$x))
    ...............
}

But unfortunately R will do first the calculations and then afterwards return the strings.

Is there a way around?


Thanks

Bart

	[[alternative HTML version deleted]]

