Hi,

The patch attachment did not make it in my previous mail.  I have
pasted it below.

Thanks,
Patrick McCormick

diff -U3 -r foreign_0.8-45/R/writeForeignSAS.R foreign/R/writeForeignSAS.R
--- foreign_0.8-45/R/writeForeignSAS.R  2010-12-17 07:17:32.000000000 -0500
+++ foreign/R/writeForeignSAS.R 2011-09-16 14:57:46.518814100 -0400
@@ -50,6 +50,7 @@
     ## FIXME: re-write this to hold a connection open
     factors <- sapply(df, is.factor)
     strings <- sapply(df, is.character)
+    logicals <- sapply(df, is.logical)
     dates <- sapply(df, FUN = function(x) inherits(x, "Date") ||
inherits(x, "dates") || inherits(x, "date"))
     xdates <- sapply(df, FUN = function(x)  inherits(x, "dates") ||
inherits(x, "date"))
     datetimes <- sapply(df, FUN = function(x) inherits(x, "POSIXt"))
@@ -63,6 +64,8 @@
     dfn <- df
     if (any(factors))
         dfn[factors] <- lapply(dfn[factors], as.numeric)
+    if (any(logicals))
+        dfn[logicals] <- lapply(dfn[logicals], as.numeric)
     if (any(datetimes))
         dfn[datetimes] <- lapply(dfn[datetimes],
                                  function(x) format(x, "%d%b%Y %H:%M:%S"))

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to