-2

I'm running an example about Markov Chain. Everything is working so far except for this code produces an error:

ra2 <- ra %^% 2

Error in ra %^% 2 : could not find function "%^%"

Magrittr package doesn't include the above operator. Any feedback?

NelsonGon
  • 13,015
  • 7
  • 27
  • 57
youraz
  • 463
  • 4
  • 14
  • 1
    This is described in the context : `the efficient operator %^% from the expm package is used to raise the Oz matrix to the third power.` – Darren Tsai Jan 28 '19 at 08:52
  • 1
    The code in this example includes the required `library` calls. Run them. – Roland Jan 28 '19 at 09:06

1 Answers1

3

That is the efficient operator %^% from package expm. It computes the k-th power of a matrix. Therefore you need to load or install the expm package first.

NelsonGon
  • 13,015
  • 7
  • 27
  • 57
Leevo
  • 1,683
  • 2
  • 17
  • 34