체계적 사고

R에서 S3와 R6로 배우는 Object-Oriented Programming

Richie Cotton

Data Evangelist at DataCamp

ch2_2-methodical-thinking.003.png

R에서 S3와 R6로 배우는 Object-Oriented Programming
methods
R에서 S3와 R6로 배우는 Object-Oriented Programming
methods("mean") # or methods(mean)
mean.Date     mean.default  mean.difftime mean.POSIXct 
mean.POSIXlt 
see '?methods' for accessing help and source code
R에서 S3와 R6로 배우는 Object-Oriented Programming

ch2_2-methodical-thinking.009.png

R에서 S3와 R6로 배우는 Object-Oriented Programming
methods(class = "glm") # or methods(class = glm)
add1           anova          coerce        
confint        cooks.distance deviance      
drop1          effects        extractAIC    
family         formula        influence     
initialize     logLik         model.frame   
nobs           predict        print         
residuals      rstandard      rstudent      
show           slotsFromS3    summary       
vcov           weights       
see '?methods' for accessing help and source code
R에서 S3와 R6로 배우는 Object-Oriented Programming

 

 

 

methods()S3S4 메서드를 모두 반환합니다

R에서 S3와 R6로 배우는 Object-Oriented Programming
.S3methods(class = "glm")
add1           anova          confint       
cooks.distance deviance       drop1         
effects        extractAIC     family        
formula        influence      logLik        
model.frame    nobs           predict       
print          residuals      rstandard     
rstudent       summary        vcov          
weights       
see '?methods' for accessing help and source code
R에서 S3와 R6로 배우는 Object-Oriented Programming
.S4methods(class = "glm")
coerce      initialize  show        slotsFromS3
see '?methods' for accessing help and source code
R에서 S3와 R6로 배우는 Object-Oriented Programming

요약

  • methods()는 제네릭의 메서드 찾기
  • ... 또는 클래스의 메서드
  • .S3methods()S3 전용 메서드 찾기
R에서 S3와 R6로 배우는 Object-Oriented Programming

연습해 봅시다!

R에서 S3와 R6로 배우는 Object-Oriented Programming

Preparing Video For Download...