edugca / xlRcode

Call R from Excel. Create new Excel functions that make use of R packages. Integrate both tools seamlessly.
MIT License
34 stars 1 forks source link

Documentation or More Example to Use XLRSCRIPT #3

Open arisdnt opened 1 year ago

arisdnt commented 1 year ago

can I get more complete documentation, or examples for using the function from XLRSCRIPT? Thank you.

edugca commented 1 year ago

Hi Aris,

All the documentation currently available is in the spreadsheet below: https://github.com/edugca/xlRcode/blob/master/xlRcode%20-%20Main.xlsx

You will note that there is a tab for each function, including one for XLRSCRIPT.

This function runs the commands written in a R script file and allows the user to transfer values from and to Excel. The first parameter is a string with the path to the R script file. The next parameters are optional and they represent the variables you may want to pass to the script code before running it. They are stated in pairs, where the first parameter is a string that stands for the name of the variable to be created, and the second parameter is its value. After running the code, the function XLRSCRIPT returns the result of the last line of the script. Say you want to return the value of a variable called XXX, then you should write XXX in the last line of your script.

The difference between XLRSCRIPT and XLRSCRIPT_ENV is that in the former all variables are cleared from the computer memory after running the script, whereas in the latter they remain available to other function calls.

So far, the examples available are the ones in the folder "Examples" of this repository.

I hope this clarifies.

Best, Eduardo

arisdnt commented 1 year ago

thanks for the response given... I have read the documentation/examples provided. but I'm still having a hard time understanding

Can I get more varied case examples? focus on educational statistics?

edugca commented 1 year ago

What's exactly your doubt?

If you write =XLRCODE("1+1") in a cell and it returns 2, then XLRCODE should be running ok in your machine.

The example below =XLRCODE("a+b", "a", 1, "b", 2) should return 3 Note that I passed two variables (a and b) and gave them the values 1 and 2, respectively.

XLRSCRIPT follows the same logic.