> -----Original Message----- > From: [email protected] > [mailto:[email protected]] On > Behalf Of sant > Sent: Wednesday, April 06, 2011 08:17 > To: [email protected] > Subject: [datatable-help] Data type unintentionally > converting on data tableon join > > Hello all, > > Sorry if this is obvious but once of my variable(datetime) is > automatically changing with a join operation. I am not sure > if this expected and I don't want that to happen I have three > datasets the dputs are given at the end of the mail. > > The problem I am facing is shown as follows (pls help): > > #d1$datetime is num here > str(d1) > > #Doing a join > tmp <- J(d1,d2,d3)
That's not what J is for. If you just want to rbind columns, do this: data.table(d1, d2, d3) If you want true joins, do something like this: setkey(d1, Id) setkey(d2, Id) merge(d1, d2) Or to merge individual entities, do: d1$price <- d2[d1, price] - Tom _______________________________________________ datatable-help mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
