~ubuntu-branches/ubuntu/utopic/foreign/utopic

« back to all changes in this revision

Viewing changes to R/read.dta.R

  • Committer: Package Import Robot
  • Author(s): Dirk Eddelbuettel
  • Date: 2014-01-21 06:49:00 UTC
  • mfrom: (1.3.24)
  • Revision ID: package-import@ubuntu.com-20140121064900-94hi99chgswzehcq
Tags: 0.8.58-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
    }
62
62
 
63
63
    if (convert.dates) {
64
 
        ff <- attr(rval,"formats")
65
 
        dates <- grep("%-*d", ff)
 
64
        ff <- attr(rval, "formats")
 
65
        ## dates <- grep("%-*d", ff)
 
66
        ## Stata 12 introduced 'business dates'
 
67
        ## 'Formats beginning with %t or %-t are Stata's date and time formats.'
 
68
        ## but it seems some are earlier.
 
69
        dates <- if (attr(rval, "version") >= 8L) grep('%-*d|^%t|%-t', ff)
 
70
        else grep("%-*d", ff)
66
71
        ## avoid as.Date in case strptime is messed up
67
72
        base <- structure(-3653, class = "Date")
68
73
        for(v in dates) rval[[v]] <- base+rval[[v]]