1
有什麼方法可以使用cat()
顯示call
對象(match.call()
的結果)?在調用對象中使用cat()
例如:
func <- function(...) {
return(match.call())
}
result <- func(x=3)
print(result)
# func(x = 3) - Exactly what I want.
cat(result)
# Erro em cat(list(...), file, sep, fill, labels, append) :
# argumento 1 (tipo 'language') não suportado por 'cat'
我想保存一個txt文件中使用的命令,所以我不能使用打印(至少,我覺得我不能)。我搜索了print.call()
函數,但我沒有找到它。
我試過paste(result)
,太多,但它僅返回函數的名稱和參數的值(在本例中,只有func
和3
)