Possible Duplicate:
How to be alerted about the ongoing progress of a loop/lapply
While debugging a R program, I would like to print the output information to the screen for the debugging purposes. For instance, how to generate something like the following in the same line.
"loop= 5", "a=5","b=5"
Taking @Matthew’s suggestion, the problem may just be that you are attempting to use
printon several variables/strings at once. This wont work.If you want to use
printwith strings, you need to give one, single string. And the most effective way of doing this is usingpaste().There are also many alternatives, such as
catandsprintf. Here is a brief example:Let’s create some sample variables to output
i <- 3
a <- letters[1:5]
You may be trying to do this:
Instead try one of the following:
(note:
paste0is the same as usingpaste(..., sep=""))