EviewsR: test R package on macOS

For questions regarding programming in the EViews programming language.

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

sagirumati
Posts: 8
Joined: Mon May 16, 2022 2:47 am

EviewsR: test R package on macOS

Postby sagirumati » Tue May 17, 2022 11:28 am

Dear Esteemed Members,

Please I need someone, who uses EViews on MacOS, to help me test my R package EviewsR, which facilitates communication with EViews from R, using the following steps:

1. Install R, if you have not done so already
2. Open R Console (or Rstudio)
3. Execute the following R codes

install.packages('EviewsR')

library(EviewsR)

demo(eviews_wfcreate())

4. Press Enter (return key) to execute the demo.

Please let me know if it works or throws an error.

Thank you in advance

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

Re: EviewsR: test R package on macOS

Postby EViews Steve » Wed May 18, 2022 8:25 am

Interesting. I see your library creates an EViews program, launches EViews to run it, then gets the results from output files. Since MacOS does not have COM Automation support, I suppose this is the only way to talk to EViews from R unless we provided a native library.

I'll try this out on a Mac sometime tomorrow and let you know.

Steve

sagirumati
Posts: 8
Joined: Mon May 16, 2022 2:47 am

Re: EviewsR: test R package on macOS

Postby sagirumati » Thu May 19, 2022 12:53 am

EViews Steve wrote:Interesting. I see your library creates an EViews program, launches EViews to run it, then gets the results from output files. Since MacOS does not have COM Automation support, I suppose this is the only way to talk to EViews from R unless we provided a native library.

I'll try this out on a Mac sometime tomorrow and let you know.

Steve



Thank you for your efforts. I look forward to your feedback

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

Re: EviewsR: test R package on macOS

Postby EViews Steve » Thu May 19, 2022 9:17 am

Macbook Pro (2017 running Intel i7)
MacOS Big Sur (11.0.1)
RStudio v2022.02.2 Build 485
R v3.6.3

I installed the binary version of your library (v 0.1.0) since the source version was giving me a script error during package install.

Here's the error:

2022-05-19_09h13_02.png
2022-05-19_09h13_02.png (62.58 KiB) Viewed 3116 times

sagirumati
Posts: 8
Joined: Mon May 16, 2022 2:47 am

Re: EviewsR: test R package on macOS

Postby sagirumati » Thu May 19, 2022 10:09 am

EViews Steve wrote:Macbook Pro (2017 running Intel i7)
MacOS Big Sur (11.0.1)
RStudio v2022.02.2 Build 485
R v3.6.3

I installed the binary version of your library (v 0.1.0) since the source version was giving me a script error during package install.

Here's the error:

2022-05-19_09h13_02.png



Thank you for your efforts. EviewsR version 0.1.0 works on Windows only. Please install the development version from github and try again as follows:

install.packages('devtools')

devtools::install_github('sagirumati/EviewsR')

library(EviewsR)

demo(eviews_wfcreate())


Could I please know the error message you received when you tried to install the source version? I would like to get it fixed.

Thank you once again for your help.

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

Re: EviewsR: test R package on macOS

Postby EViews Steve » Thu May 19, 2022 2:10 pm

Here's the error from the source version:
install source error.png
install source error.png (132.84 KiB) Viewed 3108 times

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

Re: EviewsR: test R package on macOS

Postby EViews Steve » Thu May 19, 2022 2:16 pm

Tried your install_github call, and got a similar error as before:
2022-05-19_14h14_35.png
2022-05-19_14h14_35.png (116.79 KiB) Viewed 3106 times

sagirumati
Posts: 8
Joined: Mon May 16, 2022 2:47 am

Re: EviewsR: test R package on macOS

Postby sagirumati » Fri May 20, 2022 7:40 am

EViews Steve wrote:Tried your install_github call, and got a similar error as before:
2022-05-19_14h14_35.png



I appreciate your efforts.

You are getting the error because you are using R version 3.6 instead of 4.2 (the latest version)
I made minor updates to the development version on Github. Please install the latest R version (4.2) and run the following:

devtools::install_github('sagirumati/EviewsR')

library(EviewsR)

demo(eviews_wfcreate())



Thank you once again for your help. I can't thank you enough

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

Re: EviewsR: test R package on macOS

Postby EViews Steve » Fri May 20, 2022 10:58 am

Ok, got farther this time.

I have EViews 11 University & EViews 12 University installed on this mac. Since our student version can't save any output files, I'm assuming you wrote your library to use these university versions (we don't have a Mac version for our normal Standard & Enterprise version).

However, when I tried to run your demo, I got and error:
2022-05-20_10h55_58.png
2022-05-20_10h55_58.png (201.1 KiB) Viewed 3080 times


Let me know how I can change the path to the EViews executable.

sagirumati
Posts: 8
Joined: Mon May 16, 2022 2:47 am

Re: EviewsR: test R package on macOS

Postby sagirumati » Fri May 20, 2022 1:46 pm

EViews Steve wrote:Ok, got farther this time.

I have EViews 11 University & EViews 12 University installed on this mac. Since our student version can't save any output files, I'm assuming you wrote your library to use these university versions (we don't have a Mac version for our normal Standard & Enterprise version).

However, when I tried to run your demo, I got and error:
2022-05-20_10h55_58.png

Let me know how I can change the path to the EViews executable.


I am grateful for your time and effort.

Good news. We are almost there.

Now that you have the package installed, please run the following lines of codes:

library(EviewsR)

set_eviews_path("path/to/your/eviews/executable.exe")

demo(eviews_wfcreate())



If I know the default path to the EViews executable on macOS, I will make the package automatically detect the EViews executable.


Thank you once again

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

Re: EviewsR: test R package on macOS

Postby EViews Steve » Fri May 20, 2022 4:37 pm

I tried to set the path to the EViews 12 application, but your set_eviews_path method didn't like that.

Then I tried to dig into our app contents and pinpoint the exact EViews exe file that is run by the app, but then your library didn't like that either.

By the way, our Mac app is done by using a Wine wrapper (EViews12Univ.app) around a special Windows version of our app (EViews12UnivMac_x64.exe). Even if you have the path to the actual Windows exe, you can't run it directly on the Mac (which is why we use a Wine wrapper).

I suggest you change your set_eviews_path to allow .app file extensions. And make sure it works with spaces in the pathname.

Here are the two attempts:
2022-05-20_16h30_59.png
2022-05-20_16h30_59.png (112.75 KiB) Viewed 3064 times

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

Re: EviewsR: test R package on macOS

Postby EViews Steve » Fri May 20, 2022 4:45 pm

One more thing...

I just spoke with our Mac developer and he informed me that currently there's no way for the Wine app wrapper (EViews12Univ.app) to pass along a command line parameter to the Windows exe (EViews12Univ_x64.exe). So this means the Mac version can't currently run a program upon startup and then quit.

Because of this, I don't think your EviewsR library will be able to work with our Mac version.

Sorry.

Steve

sagirumati
Posts: 8
Joined: Mon May 16, 2022 2:47 am

Re: EviewsR: test R package on macOS

Postby sagirumati » Sat May 21, 2022 10:01 am

EViews Steve wrote:One more thing...

I just spoke with our Mac developer and he informed me that currently there's no way for the Wine app wrapper (EViews12Univ.app) to pass along a command line parameter to the Windows exe (EViews12Univ_x64.exe). So this means the Mac version can't currently run a program upon startup and then quit.

Because of this, I don't think your EviewsR library will be able to work with our Mac version.

Sorry.

Steve




Thank you for your feedback. Your effort is commendable.

You can set any character as the as path of EViews, the first error is because you used backlash (\) instead of a forward slash (/) in the path. Please try the following codes in R.

library(EviewsR)
set_eviews_path("EViews12Univ.app")
demo(eviews_wfcreate())


The package works on Windows because I can open or run Eviews program file from the command line with any of the following codes (CMD or PowerShell)

1. eviewsExecutable.exe EViewsProgramFile.prg
2. eviewsExecutable.exe exec EViewsProgramFile.prg
3. eviewsExecutable.exe run EViewsProgramFile.prg
4. path/to/the/EViewsProgramFile.prg


All I need for the package to work with macOS is the ability to run or open eviewsProgramFile.prg from the command line. So if any of the following codes on macOS command line, I will update the package. I numbered the codes in order of preference

1. EViews12Univ.app exec EViewsProgramFile.prg
2. EViews12Univ.app run EViewsProgramFile.prg
3. EViews12Univ.app EViewsProgramFile.prg
4. EViews12Univ_x64.exe exec EViewsProgramFile.prg
5. EViews12Univ_x64.exe run EViewsProgramFile.prg
6. EViews12Univ_x64.exe EViewsProgramFile.prg
7. EViews12Univ_x64.exe EViewsProgramFile.prg



Please try the R codes included in this reply, if it works, then I don't need to update the package. Otherwise, please try the macOS command line codes above or tell me how I can open or run EviewsProgramFile.prg from the command line.

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

Re: EviewsR: test R package on macOS

Postby EViews Steve » Mon May 23, 2022 9:29 am

Like I said in my previous post, there currently is no way to launch EViews 12 University on the mac with a command line parameter. So there is no way to ask it to run a program upon startup.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 12 guests