1

I have 2 environments I would like to compare. What is the best way to do that? Should I use some sort of binary comparison to check if they are identical? I currently tried the following options, but I am not sure if its the proper way:

env1 = load("environment1")
env2 = load("environment2")

all.equal(env1, env2)

identical(env1, env2)

both return true, I tried isTRUE(all.equal.environment(env1,env2)) , this returns FALSE since its says its characters I'am comparing..

I am pretty new in R , so all tips are welcom!

Sathish
  • 12,453
  • 3
  • 41
  • 59

1 Answers1

0

I found this: https://www.r-bloggers.com/2021/01/how-to-compare-objects-in-r/ install and load the package "waldo", and then run compare

file1 <- "environment2"
file2 <- "environment2"
file1.data <- load (file1, file1.env <- new.env ())
file2.data <- load (file2, file2.env <- new.env ())
compare (file1.env, file2.env)
Greg Dougherty
  • 3,281
  • 8
  • 35
  • 58