说我有以下功能:多评论()用于功能属性
sqrt_x = function(x) {
sqrtx = x^0.5
return(list("sqrtx" = sqrt))
}
attr(sqrt_x, "comment") <- "This is a comment to be placed on two different lines"
如果我键入
comment(sqrt_x)
我得到
[1] "This is a comment to be placed on two different lines"
我想要的东西,但是,该评论是在两个不同的行上返回的(它也可以是更多的行和不同的评论元素,任何想法都可以使用)
'comment(sqrt_x)< - “我的评论”是一个更清晰的方式来指定评论。 –
thx,但是,它不会给我更多的内线, – Toby