I am trying to create a simple function that finds the number of days
between two dates. However, when I run the  function, R gives me an error
message saying:



unexpected '}' in "        }"

Here is my function:

#create a function that finds the number of days between two dates
diffdate<-function(x,y){
        z<-unclass(as.Date(x))
        z1<-unclass(as.Date(y))
        }
        {
                return z1-z
        }

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to