3
$\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$
19
  • $\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
    Commented Nov 18, 2014 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
    Commented Nov 19, 2014 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
    Commented Nov 19, 2014 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
    Commented Nov 19, 2014 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
    Commented Nov 20, 2014 at 20:45

1 Answer 1

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$
2
  • $\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
    Commented Nov 19, 2014 at 15:46
  • $\begingroup$ I amended my whole question. Please check. $\endgroup$
    – Eric
    Commented Nov 19, 2014 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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