Worth to mention the new package from the Hadley-verse: waldo
Gives really nice, concise, and informative messages with respect to the differences.
library(waldo)
compare(df1$Date, df2$Date)
#> ? No differences
data
# devtools::install_github("alistaire47/read.so")
df1 <- read.so::read_md("|Symbol | Date | volume |price |
|------------------------------------
|A |2014-01-01 | 1 | 5 |
|A |2014-01-02 | 3 | 8 |
|A |2014-01-03 | 7 | 4 |
|A |2014-01-07 |3 | 6 |
|A |2014-01-08 |34 | 7 |
|A |2014-01-09 |45 | 34 |
|A |2014-01-10 |4 | 5 |
|A |2014-01-11 |9 | 7 |
|A |2014-01-14 |8 | 6 |
|A |2014-01-15 |4 | 4 |
|A |2014-01-16 |0 | 7 |
|A |2014-01-17 |4 | 7 |")
df2 <- read.so::read_md("| Date | returns|
|--------------------
|2014-01-01 | 4 |
|2014-01-02 | 6 |
|2014-01-03 | 8 |
|2014-01-07 | 2 |
|2014-01-08 | 14 |
|2014-01-09 | 5 |
|2014-01-10 | 1 |
|2014-01-11 | 2 |
|2014-01-14 |8 |
|2014-01-15 |4 |
|2014-01-16 |0 |
|2014-01-17 |4 |")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…