0

I have two datasets that have the same information in columns 7 through 10, but in the opposite order. If I check each column individually, I a "True" for each execution.

> identical(d_activity[10], d_intensities[7])
[1] TRUE
> identical(d_activity[9], d_intensities[8])
[1] TRUE
> identical(d_activity[8], d_intensities[9])
[1] TRUE
> identical(d_activity[7], d_intensities[10])
[1] TRUE

However, if I try to compare them all at once, I get a "False". Is comparing multiple columns at once not possible? Or is there error in my code? I could only find examples of comparing one column. Thanks in advance for any assistance.

> identical(d_activity[10, 9, 8, 7], d_intensities[7, 8, 9, 10])
[1] FALSE
iRevan
  • 53
  • 4
  • 3
    It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. It probably should be `identical(d_activity[c(10, 9, 8, 7)], d_intensities[c(7, 8, 9, 10)])` – MrFlick Feb 05 '22 at 22:08
  • Appreciated, this did resolve the issue, and it makes sense why. I will look into the link you posted on improving future posts within Stack Overflow. Cheers. – iRevan Feb 05 '22 at 22:26
  • Please provide enough code so others can better understand or reproduce the problem. – Community Feb 12 '22 at 01:10

0 Answers0