[R] Problems merging with POSIXct objects and all = TRUE

David Kane <David Kane a296180 at mica.fmr.com
Thu Oct 4 20:53:39 CEST 2001


I am having problems using merge with all = TRUE when one of the dataframes has
objects of class POSIXct. If this is a bug, let me know and I will report it to
r-bugs. Here is an example:

> version
         _                   
platform sparc-sun-solaris2.6
arch     sparc               
os       solaris2.6          
system   sparc, solaris2.6   
status                       
major    1                   
minor    3.0                 
year     2001                
month    06                  
day      22                  
language R                   
> x <- data.frame(a = as.POSIXct(Sys.time() + (1:3)*10000), b = LETTERS[1:3])
> x
                    a b
1 2001-10-04 17:37:46 A
2 2001-10-04 20:24:26 B
3 2001-10-04 23:11:06 C
> y <- data.frame(b = LETTERS[3:4], c = 1:2)
> y
  b c
1 C 1
2 D 2
> merge(x, y)
  b                   a c
1 C 2001-10-04 23:11:06 1		# This answer is correct
> merge(x, y, all = TRUE)
Error in as.POSIXct.default(value) : Don't know how to convert `value' to class "POSIXct"

Any insights would be much appreciated.

Regards,

Dave Kane
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list