2
$\begingroup$

I am trying to call the R-programming package called highfrequency in my Mathematica so that I can use its function rCov. I tried to call this by using

Needs["RLink`"];
InstallR[];
install.packages;
REvaluate["library(highfrequency)"]

Then, I receive the following error:

REvaluate::rerr: Failed to retrieve the value for variable or piece of code 
library(highfrequency). The following R error was encountered: Error in library    
(highfrequency) : 
there is no package called 'highfrequency' >>

This error is the same no matter what different R-packages I call within Mathematica. However, I think the Mathematica command REvaluate may not be appropriate in calling R-packages. May I know how I can resolve this issue?

$\endgroup$
  • $\begingroup$ I'm afraid I don't know what realized covariance means. Perhaps the easiest solution is to use RLink and directly use the R implementation. Otherwise, please edit the question with enough information so that we can construct such a function -- perhaps with an example showing what calculation you desire to implement. $\endgroup$ – bill s Nov 18 '14 at 15:07
  • $\begingroup$ @bill s: Thanks a lot. Then may I know how I can use RLink and directly use the R implementation? I have never tried in that way before. $\endgroup$ – Eric Nov 19 '14 at 0:16
  • $\begingroup$ You need to install R the package first using install.packages. With RLink this is only possible on Windows. Otherwise you can install the package into an external R installation (separate from RLink), then set up RLink to use this external R $\endgroup$ – Szabolcs Nov 19 '14 at 16:31
  • $\begingroup$ It looks like this package was removed from CRAN though ... cran.r-project.org/web/packages/highfrequency/index.html $\endgroup$ – Szabolcs Nov 19 '14 at 16:37
  • 1
    $\begingroup$ @Szabolcs: Ah..now it works. The InstallR[] was not supposed to be mixed with my command. After I removed it, it gave me the correct version. Thank you very much! $\endgroup$ – Eric Nov 20 '14 at 20:45
1
$\begingroup$

I'm afraid I don't know what realized covariance means. Perhaps the easiest solution is to use RLink and directly use the R implementation. Here are some links to the documentation to get you started.

http://reference.wolfram.com/language/RLink/guide/RLink.html

http://reference.wolfram.com/language/RLink/tutorial/UsingRLink.html

$\endgroup$
  • $\begingroup$ Thanks. But if I have a certain R-command like rCov only unique to the R-package called highfrequency but not a general R-command, do you know how possibly I can bring either the highfrequency package and/or the rCov command unique only to the highfrequecy package? $\endgroup$ – Eric Nov 19 '14 at 15:46
  • $\begingroup$ I amended my whole question. Please check. $\endgroup$ – Eric Nov 19 '14 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.