gdemin / excel.link

Convenient Data Exchange between R and Microsoft Excel
56 stars 16 forks source link

UDF RExec in R_connection_examples.xlsm Error in R script due to "," decimal point (?) #13

Closed jacekkotowski closed 6 years ago

jacekkotowski commented 6 years ago

In Poland I am using US version of Excel with Polish locales. All excel formula parameters are separated with ";" and all decimal points are "," It is probably why UDF RExec fails to execute throwing "Error in R script." If it is an issue, is it possible to add parameter for decimal point?

I am afraid separator can also be an issue, since I often read csv's with csv2 function or specify ";" as separator. Is it possible also to specify separator?

Maybe it is possible to set both decimal point and separator globally for a session with one command like in data.pasta package?

It is also possible, that some other issue related to local settings may interfere like a symbol separating rows in matrix (?)

I would like to thank you for sharing this wonderful, very promising project! It ma be great in environments where Excel rules and it is a struggle to promote R as a better tool.

gdemin commented 6 years ago

Could you provide example of your code/spreadsheet?

In most cases decimal separator is converted internally. I didn't encounter any problem with it nevertheless is it comma or point.

jacekkotowski commented 6 years ago

Dear Gregory,

I am using your spreadsheet (R_connection_examples.xlsm) from github of excel.link Anything I try to use results in Run-time error '-2147220482(900403fe)' Error in R script.

Debugger shows line in function: Public Function ExecInR

The line is: Err.Raise vbObjectError + 1022, Source:="RCaller module.ExecInR", Description:="Error in R script."

I needed to change path to my R installation, because there was no path in SET PATH and I have no access to it. there is a space in the path, but the VBA seems to work ok, talk to R, but the result is wrong.

I do not know what happened.

I enclose the file.

I wish you all the best.

Jacek Kotowski

http://wypadek-uminskiego.blogspot.com/ Postawmy sygnalizację na przejściu Umińskiego przy SP312!

http://jakprzetlumaczyc.blogspot.com (prywatny blog zawodowy, data mining, R, excel)

http://www.linkedin.com/in/jacekkotowski tel +48 605961341 jacek.kotowski@gmail.com skype:beckett71

On Fri, Oct 27, 2017 at 2:30 PM, Gregory Demin notifications@github.com wrote:

Could you provide example of your code/spreadsheet?

In most cases decimal separator is converted internally. I didn't encounter any problem with it nevertheless is it comma or point.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gdemin/excel.link/issues/13#issuecomment-339958058, or mute the thread https://github.com/notifications/unsubscribe-auth/AKjzUqbNoGBy7L8Rz7DUOVXHKZAG__8Xks5swczygaJpZM4QI6T_ .

gdemin commented 6 years ago

Sorry, I don't see the file. Could you attach it one more time? Also it may be useful if you give me sessionInfo() ouput in your R console.

gdemin commented 6 years ago

Please, try new R_connection_examples.xlsm. I made some fixes and I hope it will work.

jacekkotowski commented 6 years ago

It works now. I will play with it extensively to see if anything shows up. Thanks very much. I wish you all the best.

gdemin commented 6 years ago

Fixed in version 0.9.8