[R] print() required sometimes in interactive use of console

Giles Crane gilescrane at verizon.net
Wed Jan 26 21:27:11 CET 2011


Surprising behavior:
Most R users are aware that print()
must be used inside functions to gain
output on the console.

Apparently, print() is sometimes required
when interactively using the console.
For example, the followingmay be
entered into the R console with different results.

sample(1:8,8)      #prints a permutation of 1 to 8

for(i in 1:5)           #does not
     sample(1:8,8)



Cordially,
Giles Crane



More information about the R-help mailing list