2016-09-27 3 views
0

속성을 사용하여 Zoo 객체로 새 시계열 클래스를 만들고 싶습니다. "zoo"클래스가 인식되지 않습니다.Zoo 객체 속성을 사용하여 R 클래스 S4 클래스 만들기

library(zoo) 
setClass("timeseries", representation(ts = "zoo", name = "character"),) 
Warning message: 
undefined slot classes in definition of "timeseries": ts(class "zoo") 

동물원 개체를 특성으로 사용하여 클래스를 만들려면 어떻게해야합니까?

답변

1

다음 코드는 작업을 수행합니다.

library(zoo) 
setOldClass("zoo") 
setClass("timeseries", representation(ts = "zoo", name = "character")) 
관련 문제