nalimilan / R2HTML

R2HTML: HTML exportation for R objects
http://cran.r-project.org/web/packages/R2HTML
3 stars 5 forks source link

return(invisible(.)), not invisible(return(.)) #5

Closed MichaelChirico closed 2 years ago

MichaelChirico commented 2 years ago

In the latter, invisible() is a no-op because return executes first. Observe:

foo = function(x) invisible(return(x))
bar = function(x) return(invisible(x))

foo(5)
# [1] 5
bar(5)
tfry-git commented 2 years ago

Thanks!