R Integration

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

Dennis
Posts: 16
Joined: Fri Dec 16, 2011 8:11 am

R Integration

Postby Dennis » Sun Dec 17, 2017 8:01 am

I tried the R Connector in Eviews 10, and it worked seamlessly. The Help file shows how to use XGET to bring coefficients into an Eviews workfile, and that also worked fine. However, I don't know how to bring other parts of R output into Eviews (e.g., std errors of coefs, t-stats, p-values). Is it possible to bring multiple columns of output from an R command back to Eviews, e.g., as an Eviews object? More generally, any guidance about getting results from R into to an Eviews workfile would be much appreciated.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13306
Joined: Tue Sep 16, 2008 5:38 pm

Re: R Integration

Postby EViews Gareth » Mon Dec 18, 2017 9:04 am

Yes it is possible - from EViews' point of view there is no difference between coefficients and other values.

Without knowing the structure of the objects you are trying to retrieve, it is hard to give further advice.
Follow us on Twitter @IHSEViews

EViews Steve
EViews Developer
Posts: 788
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: R Integration

Postby EViews Steve » Mon Dec 18, 2017 7:03 pm

Our Get method takes a string. Just provide a string that represents what your trying to retrieve. You can also try just using the Run command and pass it “print expression” where expression is what you’re trying to get. That should print the value in the R Console window. Once you see the correct value, call Get with just the expression.


Sent from my iPhone using Tapatalk

EViews Steve
EViews Developer
Posts: 788
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: R Integration

Postby EViews Steve » Mon Dec 18, 2017 7:06 pm

Sorry I meant XGET and XRUN.


Sent from my iPhone using Tapatalk

Dennis
Posts: 16
Joined: Fri Dec 16, 2011 8:11 am

Re: R Integration

Postby Dennis » Fri Dec 29, 2017 9:03 pm

Thanks very much for explaining how to retrieve information from R. Your response is a great help.

I have another question. I believe that, with the XPUT command, NA's in Eviews are passed as zeros to R. Is there a setting that will require NA's from Eviews to be passed as NA's to R. The command I am using has the following form: XPUT(rtype=data.frame, name=vars) y x1 x2 ... xk

EViews Steve
EViews Developer
Posts: 788
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: R Integration

Postby EViews Steve » Tue Jan 02, 2018 9:39 am

I just confirmed that our R connector is not handling NAs correctly. This will be fixed in the next patch.

Steve

Shwan
Posts: 10
Joined: Thu Dec 21, 2017 7:03 am

Re: R Integration

Postby Shwan » Wed Nov 27, 2019 2:29 am

Hi, thanks for this amazing feature!
Im trying to use R integration to run a type of TVP VAR. It works well until I try the R confint command to generate the confidence interval for IRF. The error is: Server Busy, the action can not be completed because the other program is busy. Choose Switch To to activate the busy program and correct the problem.
Can you help me what this error is related to?
Thanks

EViews Steve
EViews Developer
Posts: 788
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: R Integration

Postby EViews Steve » Wed Nov 27, 2019 1:08 pm

Most likely the previous R command you ran is taking a long time to complete. Are you getting confirmation in the console log window that the command completed successfully? Or are you trying to display a modal dialog that might be waiting for you to dismiss before returning back to EViews?

Shwan
Posts: 10
Joined: Thu Dec 21, 2017 7:03 am

Re: R Integration

Postby Shwan » Thu Nov 28, 2019 3:46 am

Thank you for your answer Steve!

actually I don't get confirmation for successful completion of the previous step, even if the code is not running and I wait so long the previous step does not generate any confirmation message, although it doesnt also generate error message! so it gives the impression that its done!

I checked on with other commands and they work well without error, so the problem is not with the previous command and it is with the command that I run and get error. I googled a bit and what I found is that this error can be related to the setting of my software and I should change the default protocol, however its not easy because Im using the work computer and I need to contact IT and ask them to do that, so before going to that process I want to be sure it will solve my problem.

Any help is appreciated

Shwan
Posts: 10
Joined: Thu Dec 21, 2017 7:03 am

Re: R Integration

Postby Shwan » Fri Nov 29, 2019 5:50 am

Just an update!
I checked the PC default protocol and it was correct. I contacted with IT department and they thought the problem might be related to my library path, so I changed the library location and still didn't work, then we thought as the codes stop working when its simulation turn there might not be enough space to save the simulation results so they increased my capacity with 10 GB and still doesn't work! As I went through all the possible solutions and still is not working can I conclude this can be a bug in integration of R and Eviews?

EViews Steve
EViews Developer
Posts: 788
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: R Integration

Postby EViews Steve » Fri Nov 29, 2019 1:54 pm

Details, I need more details.

What is the command you are trying to run that seems to error?
What does the error say? Or a screenshot of the error?
Also, you should verify that the R command you are running works in R (outside of EViews).

Steve


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 28 guests