I recently worked through a strange error (with help from a couple sharp cookies at Microsoft) and wanted to throw together a quick blog post in case anybody else sees it.
I have SQL Server R Services set up, and in the process of running a fairly complex stored procedure, got the following error message:
Msg 39004, Level 16, State 22, Line 0
A ‘R’ script error occurred during execution of ‘sp_execute_external_script’ with HRESULT 0x80004005.
Check those output variable and result set definitions.