question

ArthurClifford7-2085 avatar image
0 Votes"
ArthurClifford7-2085 asked CliffordArthur-1337 commented

R- Script Error

How do I fix this issue please

Msg 39004, Level 16, State 20, Line 18
A 'R' script error occurred during execution of 'sp_execute_external_script' with HRESULT 0x80004004.
Msg 39019, Level 16, State 2, Line 18
An external script error occurred:
Error: package or namespace load failed for 'rvest' in rbind(info, getNamespaceInfo(env, "S3methods")):
number of columns of matrices must match (see arg 2)
In addition: Warning message:
package 'rvest' was built under R version 4.1.0

Error in execution. Check the output for more information.
Error in eval(ei, envir) :
Error in execution. Check the output for more information.
Calls: runScriptFile -> source -> withVisible -> eval -> eval -> .Call
Execution halted

sql-server-general
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


According to similar issues (https://www.bing.com/search?q=Error%3A+package+or+namespace+load+failed+rbind%28info%2C+getNamespaceInfo%28env%2C+%22S3methods%22%29%29) did you try to repair (uninstall and re-install) the “rvest” package, which maybe is outdated?

0 Votes 0 ·
AmeliaGu-msft avatar image
0 Votes"
AmeliaGu-msft answered

Hi ArthurClifford7-2085,
Could you please try to remove all packages in 4.1 package lib and reinstalled them?
Please refer to this thread which might help.
Best Regards,
Amelia


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

CliffordArthur-1337 avatar image
0 Votes"
CliffordArthur-1337 answered

@AmeliaGu-msft thanks for the reply. I have done that before and according to Microsoft Documentation, the current 2019 Server supports R version 3.5.2 and the recommended that these versions must match in order to write R codes in SQL.
So I uninstalled all other R versions and installed the 3.5.2.
In fact when I tried to remove all the packages in R I had a bunch of errors but had to remove the entire installation.

Must the SQL server or SSmS be pointed to the same library where the packages are installed or it doesn’t matter. Because sometimes I get the error that the packages I’m trying to call isn’t there but when I run the same code in R, it works as intended.

Many thanks

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AmeliaGu-msft avatar image
0 Votes"
AmeliaGu-msft answered CliffordArthur-1337 commented

Hi @ArthurClifford7-2085,
I am glad to know that your issue has been solved. In order to close this thread, please kindly accept your reply as answer, it will help other people who has similar issue to see it.
Best Regards,
Amelia

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@AmeliaGu-msft oh I’m sorry if I wasn’t clear in my respond. The issue has NOT been solved

0 Votes 0 ·