I have a long R-script file and I would like to use SQL Server R Services, reading about its documentation, I have not seen any example of using: sp_execute_external_script that allows loading an R-script file. All examples are intended to use simple r-computation embedded in a SQL sentences, such as the following example:
DROP PROC IF EXISTS get_iris_dataset;
go
CREATE PROC get_iris_dataset
AS
BEGIN
EXEC sp_execute_external_script
@language = N'R'
, @script = N'iris_data <- iris;'
, @input_data_1 = N''
, @output_data_1_name = N'iris_data'
WITH RESULT SETS (("Sepal.Length" float not null,
"Sepal.Width" float not null,
"Petal.Length" float not null,
"Petal.Width" float not null, "Species" varchar(100)));
END;
go
I would need in some way to use the r-sentence source("fileName") for executing the r-sentences.
Note: I am trying to use an SQL Server just because a better machine performance than my personal computer.
Thanks in advance,
David