Is it possible to have a multi-line comments in R? -
Is it possible to have a multi-line comments in R? -
this question has reply here:
multiline comment workarounds? 8 answersi found old thread (from on year ago), explains how come r doesn't back upwards multi-line comments (like /* comment */ of php, example).
i wondering if has been resolved in past year, or if there other alternatives? (for example, in notepad++ npptor, can mark bunch of lines , press ctrl+q mark them comments, there similar solutions other ide's ?)
you can, if want, utilize standalone strings multi-line comments — i've thought prettier if (false) { }
blocks. string evaluated , discarded, long it's not lastly line in function nil happen.
"this function takes value x, , things , returns things take several lines explain" doeverythingoften <- function(x) { # non! comment out! we'll 1 time now. "if (x %in% 1:9) { doteneverythings() }" doeverythingonce() ... return(list( everythingdone = true, howoftendone = 1 )) }
the main limitation when you're commenting stuff out, you've got watch quotation marks: if you've got 1 kind inside, you'll have utilize other kind comment; , if you've got "strings 'postrophes" within block, there's no way method idea. there's still if (false)
block.
the other limitation, 1 both methods have, can utilize such blocks in places look syntactically valid - no commenting out parts of lists, say.
regarding in ide: i'm vim user, , find nerd commenter utterly first-class tool commenting or uncommenting multiple lines. user-friendly, well-documented.
lastly, @ r prompt (at to the lowest degree under linux), there's lovely alt-shift-# comment current line. nice set line 'on hold', if you're working on one-liner , realise need prep step first.
r comments
Comments
Post a Comment