When I debug code in R, I track the values of parameters using many ‘print’ and ‘paste’ comments like this:

print(paste("this is the value of x:", x, "and y:", y))

‘print’ and ‘paste’ live together so much that I thought I’d save myself some time and so I made this function:

pp<-function(o1="",o2="",o3="",o4="",o5="",o6="",o7="",o8="",o9="",o10="")
{
print(paste(o1,o2,o3,o4,o5,o6,o7,o8,o9,o10, sep=""))
}

Using this function means I can now debug my code faster, with statements like this:

pp("this is the value of x: ", x, " and y: ", y)

Every time I use pp I am 0.025% happier.