Skip to content
Prev 248471 / 398503 Next

print() required sometimes in interactive use of console

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