Store output of r in a variable