[Rd] [patch] writeForeignSAS writes invalid SASdata for logical columns

From: Patrick McCormick <patrick.mccormick_at_alum.mit.edu>
Date: Sat, 17 Sep 2011 19:50:54 -0400


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_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat 17 Sep 2011 - 23:55:01 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 18 Sep 2011 - 21:20:32 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive