[R-gregmisc-commits] r2114 - pkg/SASxport/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Mar 25 23:05:55 CET 2016


Author: warnes
Date: 2016-03-25 23:05:55 +0100 (Fri, 25 Mar 2016)
New Revision: 2114

Modified:
   pkg/SASxport/R/AFirst.lib.s
   pkg/SASxport/R/makeNames.R
   pkg/SASxport/R/testDateTime.R
Log:
Remove code supporting S-Plus

Modified: pkg/SASxport/R/AFirst.lib.s
===================================================================
--- pkg/SASxport/R/AFirst.lib.s	2016-03-25 22:05:06 UTC (rev 2113)
+++ pkg/SASxport/R/AFirst.lib.s	2016-03-25 22:05:55 UTC (rev 2114)
@@ -1,5 +1,5 @@
 ##
-## Code originally from Frank Harrell's 'Hmisc' library: 
+## Code originally from Frank Harrell's 'Hmisc' library:
 ##   http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/Hmisc
 ## Copied with permission on 2007-08-04
 ##
@@ -8,8 +8,8 @@
 under.unix <- !(version$os=='Microsoft Windows' ||
                 version$os=='Win32' || version$os=='mingw32')
 
-.R.   <- TRUE
-.SV4. <- FALSE
+# .R.   <- TRUE
+# .SV4. <- FALSE
 
 .noGenenerics <- TRUE  # faster loading as new methods not used
 
@@ -17,9 +17,9 @@
   existsFunction <- function(...) exists(..., mode='function')
 }
 
-if(.R.) {  
+# if(.R.) {
   ## create some function definitions just to avoid R CMD CHECK warnings
   timeDate <- function(...) stop("Not Implemented")
-  dates <- function(...) stop("Not Implemented")
-}
+#  dates <- function(...) stop("Not Implemented")
+# }
 

Modified: pkg/SASxport/R/makeNames.R
===================================================================
--- pkg/SASxport/R/makeNames.R	2016-03-25 22:05:06 UTC (rev 2113)
+++ pkg/SASxport/R/makeNames.R	2016-03-25 22:05:55 UTC (rev 2114)
@@ -1,16 +1,16 @@
 ##
-## Code originally from Frank Harrell's 'Hmisc' library: 
+## Code originally from Frank Harrell's 'Hmisc' library:
 ##   http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/Hmisc
 ## Copied with permission on 2007-08-04
 ##
 
 makeNames <- function(names, unique=FALSE, allow=NULL)
 {
-  ## Runs make.names with exceptions in vector allow
-  ## By default, R 1.9 make.names is overridden to convert _ to . as
-  ## with S-Plus and previous versions of R.  Specify allow='_' otherwise.
-  if(!.R. & length(allow))
-    stop('does not apply for S-Plus')
+  # ## Runs make.names with exceptions in vector allow
+  # ## By default, R 1.9 make.names is overridden to convert _ to . as
+  # ## with S-Plus and previous versions of R.  Specify allow='_' otherwise.
+  # if(!.R. & length(allow))
+  #   stop('does not apply for S-Plus')
   n <- make.names(names, unique)
   if(!length(allow))
     n <- gsub('_', '.', n)

Modified: pkg/SASxport/R/testDateTime.R
===================================================================
--- pkg/SASxport/R/testDateTime.R	2016-03-25 22:05:06 UTC (rev 2113)
+++ pkg/SASxport/R/testDateTime.R	2016-03-25 22:05:55 UTC (rev 2114)
@@ -1,5 +1,5 @@
 ##
-## Code originally from Frank Harrell's 'Hmisc' library: 
+## Code originally from Frank Harrell's 'Hmisc' library:
 ##   http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/Hmisc
 ## Copied with permission on 2007-08-04
 ##
@@ -14,28 +14,32 @@
   if(!length(cl))
     return(FALSE)
 
-  dc <- if(.R.)
-          c('Date', 'POSIXt','POSIXct','dates','times','chron')
-        else
-          c('timeDate','date','dates','times','chron')
-  
-  dtc <- if(.R.)
-           c('POSIXt','POSIXct','chron')
-         else
-           c('timeDate','chron')
-  
+  # dc <- if(.R.)
+  #         c('Date', 'POSIXt','POSIXct','dates','times','chron')
+  #       else
+  #         c('timeDate','date','dates','times','chron')
+  dc <- c('Date', 'POSIXt','POSIXct','dates','times','chron')
+
+  # dtc <- if(.R.)
+  #          c('POSIXt','POSIXct','chron')
+  #        else
+  #          c('timeDate','chron')
+  dtc <- c('POSIXt','POSIXct','chron')
+
   switch(what,
          either = any(cl %in% dc),
          both   = any(cl %in% dtc),
          timeVaries = {
-           if('chron' %in% cl || 'Date' %in% cl || !.R.) { 
+           #if('chron' %in% cl || 'Date' %in% cl || !.R.) {
+           if('chron' %in% cl || 'Date' %in% cl) {
              ## chron or S+ timeDate
              y <- as.numeric(x)
              length(unique(round(y - floor(y),13))) > 1
            }
-           else if(.R.)
+           # else if(.R.)
+           else
              length(unique(format(x,'%H%M%S'))) > 1
-           else
-             FALSE
+           # else
+           #   FALSE
          })
 }



More information about the R-gregmisc-commits mailing list