When calling a script, I want to print the code expressions and their results using echo=T as in:> source("myscript.r", echo = T)This seems to do pretty much same as print() if the script only lists expressions like "mean(data)", and echo seems nicer since it avoids extra print statements. But when I use the same expressions inside a for loop (to process multiple files), only code expressions and no results are echoed back. My questions: Does "echo=T" not print results of functions in loops? What the major difference between echo and print? Thanks! [[alternative HTML version deleted]]
When calling a script, I want to print the code expressions and their results using echo=T as in:> source("myscript.r", echo = T)This seems to do pretty much same as print() if the script only lists expressions like "mean(data)", and echo seems nicer since it avoids extra print statements. But when I use the same expressions inside a for loop (to process multiple files), only code expressions and no results are echoed back. My questions: Does "echo=T" not print results of functions in loops? What is/are the major difference/differences between echo and print? Thanks! [[alternative HTML version deleted]]