Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- myfun <- function (x) {
- UseMethod("myfun")
- }
- myfun.numeric <- function(x) {
- a<-x+5
- b<-a^2
- c<-b+4
- d<-c-3
- d
- }
- myfun.character <- function(x) {
- a<-as.numeric(x)+9
- b<-a^2
- c<-b+4
- d<-c-3
- d
- }
- myfun("3")
- myfun(3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement