Running ‘testthat.R’ [7s/15s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(ReinforcementLearning)
  > 
  > test_check("ReinforcementLearning")
  ── 1. Failure: Reinforcement learning performs correctly (@test.ReinforcementLea
  predict(model) not equal to c(s1 = "down", s2 = "right", s3 = "up", s4 = "right").
  1/4 mismatches
  x[4]: "down"
  y[4]: "right"
  
  ── 2. Failure: Reinforcement learning performs correctly (@test.ReinforcementLea
  model$Reward not equal to -263.
  1/1 mismatches
  [1] -373 - -263 == -110
  
  ── 3. Failure: Policy updating performs correctly (@test.ReinforcementLearning.R
  predict(model) not equal to c(s1 = "down", s2 = "right", s3 = "up", s4 = "right").
  1/4 mismatches
  x[4]: "down"
  y[4]: "right"
  
  ── 4. Failure: Policy updating performs correctly (@test.ReinforcementLearning.R
  model$Reward not equal to -263.
  1/1 mismatches
  [1] -373 - -263 == -110
  
  ── 5. Failure: Policy updating performs correctly (@test.ReinforcementLearning.R
  model_new$Reward not equal to 633.
  1/1 mismatches
  [1] 710 - 633 == 77
  
  ── 6. Failure: Training examples are sampled correctly (@test.sampleExperience.R
  data$State not equal to c("s4", "s2").
  2/2 mismatches
  x[1]: "s2"
  y[1]: "s4"
  
  x[2]: "s1"
  y[2]: "s2"
  
  ── 7. Failure: Training examples are sampled correctly (@test.sampleExperience.R
  data$Action not equal to c("left", "right").
  1/2 mismatches
  x[1]: "up"
  y[1]: "left"
  
  ── 8. Failure: Training examples are sampled correctly (@test.sampleExperience.R
  data$NextState not equal to c("s4", "s3").
  2/2 mismatches
  x[1]: "s1"
  y[1]: "s4"
  
  x[2]: "s1"
  y[2]: "s3"
  
  ── 9. Failure: Epsilon-greedy action selection works correctly (@test.sampleExpe
  head(data_new$State, 2) not equal to c("s4", "s2").
  2/2 mismatches
  x[1]: "s2"
  y[1]: "s4"
  
  x[2]: "s1"
  y[2]: "s2"
  
  ── 10. Failure: Epsilon-greedy action selection works correctly (@test.sampleExp
  head(data_new$Action, 2) not equal to c("down", "right").
  2/2 mismatches
  x[1]: "right"
  y[1]: "down"
  
  x[2]: "down"
  y[2]: "right"
  
  ── 11. Failure: Epsilon-greedy action selection works correctly (@test.sampleExp
  head(data_new$NextState, 2) not equal to c("s4", "s3").
  2/2 mismatches
  x[1]: "s3"
  y[1]: "s4"
  
  x[2]: "s2"
  y[2]: "s3"
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 50 SKIPPED: 0 FAILED: 11
  1. Failure: Reinforcement learning performs correctly (@test.ReinforcementLearning.R#11) 
  2. Failure: Reinforcement learning performs correctly (@test.ReinforcementLearning.R#12) 
  3. Failure: Policy updating performs correctly (@test.ReinforcementLearning.R#40) 
  4. Failure: Policy updating performs correctly (@test.ReinforcementLearning.R#41) 
  5. Failure: Policy updating performs correctly (@test.ReinforcementLearning.R#48) 
  6. Failure: Training examples are sampled correctly (@test.sampleExperience.R#21) 
  7. Failure: Training examples are sampled correctly (@test.sampleExperience.R#22) 
  8. Failure: Training examples are sampled correctly (@test.sampleExperience.R#24) 
  9. Failure: Epsilon-greedy action selection works correctly (@test.sampleExperience.R#59) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted