현재 S4 클래스에 대한 메쏘드를 작성 중이고 메쏘드 호출을 함수처럼 사용하고 match.call()을 사용하고 싶습니다. 내가 뭐하는 거지의 다음R match.call() for S4 메쏘드
내 최소한의 예 :
> meth1(new("AClass"), method = "MClust")
.local(object = object, method = "MClust")
[1] NA
> meth1(new("AClass"), method = Mclust)
.local(object = object, method = ..1)
[1] NA
질문은 다음과 같습니다 :
- 왜 기능을 할당 할 때 내가 볼이 정의와
setClass( Class = "AClass", representation = representation( name = "character" ) ) setGeneric("meth1", function(object, ...) { standardGeneric("meth1") }) setMethod( f = "meth1", signature = "AClass", definition = function(object, method, ..., warnings = TRUE) { # ... print(match.call()) return(NA) })
인수 'method'에이 인수에 대해
match.call()
에서 가져온 내용이인 경우insetad for"Mclust"
? match.call()
에서 가져온 '함수 이름'이meth1
대신.local
인 이유는 무엇입니까?변수
method
이 함수에 속해있어서"Mclust"
을 어떻게 얻을 수 있습니까?
3 번 질문의 의미를 명확히 할 수 있습니까? 'MClust' 기호를 문자로 해석 하시겠습니까? 사용자가 그것을 인용하지 않고도'MClust'에 입력 할 수있게하고 싶습니까? – BrodieG
사실 모든 질문에 답했습니다. 내가 원하는 것은''method''에 할당 된''MClust'' 문자열을 얻는 것입니다. – carlesh