alexsanjoseph / compareDF

R Tool to compare two data.frames
Other
93 stars 17 forks source link

values with sign difference not being captured by compareDF #6

Closed david2t closed 7 years ago

david2t commented 7 years ago

Hi, I'm somewhat new to R so apologies if I'm missing something obvious. I'm creating 2 data frames.

old_df = data.frame(Date=as.Date('2017-04-24'), BookID = 367, AssetID = 65507, TradedFactor = -1000000)
new_df = data.frame(Date=as.Date('2017-04-24'), BookID = 367, AssetID = 65507, TradedFactor = 1000000)
compare_df(new_df, old_df, c('Date', 'BookID','AssetID'))

The output is: Error in compare_df(new_df, old_df, c("Date", "BookID", "AssetID")) : The two data frames are the same after accounting for tolerance!

I would expect compareDF to catch the difference in values in the TradedFactor column.

Thanks, David

alexsanjoseph commented 7 years ago

@david2t

Hey, sorry for the late reply - I was out on vacation. This is currently a known limitation, since I take the difference by using the ratio rather than differences, the absolute value is taken for numeric columns.

Are you still on this? If so, I'll fix it ASAP else I'll add it to my queue to do it slowly :)

Thanks, Alex

david2t commented 7 years ago

@alexsanjoseph No worries, thanks for taking a look! Doesn't need to be ASAP, thank you :)

alexsanjoseph commented 7 years ago

@david2t - This has been fixed. Sorry for the delay!

david2t commented 7 years ago

Thank you very much!