开发者

Getting help on R command line window

开发者 https://www.devze.com 2023-01-29 11:38 出处:网络
I wanted to get help about repeat in R command line window. But > ?repeat + > help(repeat) Error: unexpected \')\' in \"help(repeat)\"

I wanted to get help about repeat in R command line window. But

> ?repeat  
+   
> help(repeat)  
Error: unexpected ')' in "help(repeat)"  

repeat seems different from other fu开发者_运维知识库nctions. Also I found even for if, I also cannot get help document. So I assume help is just for non control-follow function/command? How to get the help document about control flow commands then?

Thanks!


repeat, for, etc are parts of the language that the parser gives high priority to; in this case R thinks you were going to write something it needed to evaluate before calling the function ?() on the result. The canonical solution is to quote the function name using backticks:

?`repeat`

As DWin notes above, this can be used for any function name. Backticks are also useful for quoting objects or components of lists/data frames that have non-standard names.


help("repeat")

?"repeat"

0

精彩评论

暂无评论...
验证码 换一张
取 消