Executing an R Script

  • Comments posted to this topic are about the item Executing an R Script

  • Nice one, but I thought there is a way to pass just the script's name.

    The same way there is catalog for SSIS and a reporting DB for SSRS, it would be nice to be able to create an R library on SQL Server.

    Ta

    Iulian

  • If you got QOTD right for Oct 7th, you probably got this right too!

  • paul s-306273 (10/14/2016)


    If you got QOTD right for Oct 7th, you probably got this right too!

    +1 😉

    Yes, easy one. Thanks Steve for this question.

  • George Vobr (10/14/2016)


    paul s-306273 (10/14/2016)


    If you got QOTD right for Oct 7th, you probably got this right too!

    +1 😉

    Yes, easy one. Thanks Steve for this question.

    I didn't know the date, but remembered the question. Thanks, Steve.

  • I must have been sleeping on Oct 7, and accidently got it right. But I too thought you could pass a script name to R

    Steve Jimmo
    Sr DBA
    “If we ever forget that we are One Nation Under God, then we will be a Nation gone under." - Ronald Reagan

  • You can use source in the text of your R script to bring in a file. Cf http://stackoverflow.com/questions/3502925/include-files-r

  • Iulian -207023 (10/13/2016)


    Nice one, but I thought there is a way to pass just the script's name.

    The same way there is catalog for SSIS and a reporting DB for SSRS, it would be nice to be able to create an R library on SQL Server.

    Ta

    Iulian

    The script can be a variable. Putting this separate makes it easier to read.

  • Steve Jones - SSC Editor (10/14/2016)


    Iulian -207023 (10/13/2016)


    Nice one, but I thought there is a way to pass just the script's name.

    The same way there is catalog for SSIS and a reporting DB for SSRS, it would be nice to be able to create an R library on SQL Server.

    Ta

    Iulian

    The script can be a variable. Putting this separate makes it easier to read.

    This is more flexible than it seems. You can put R script into SQL code and in that R you can call SQL that calls another R script, there is no stated limit how deep you can go.

    You can keep your R scripts in a simple table, and more importantly, you can store your trained models in a table and pass them to R just for evaluation, which is devilishly fast. Nice symbiosis.

    (Yes, this hits my hot button. 🙂 )

  • Revenant (10/14/2016)


    Steve Jones - SSC Editor (10/14/2016)


    Iulian -207023 (10/13/2016)


    Nice one, but I thought there is a way to pass just the script's name.

    The same way there is catalog for SSIS and a reporting DB for SSRS, it would be nice to be able to create an R library on SQL Server.

    Ta

    Iulian

    The script can be a variable. Putting this separate makes it easier to read.

    This is more flexible than it seems. You can put R script into SQL code and in that R you can call SQL that calls another R script, there is no stated limit how deep you can go.

    You can keep your R scripts in a simple table, and more importantly, you can store your trained models in a table and pass them to R just for evaluation, which is devilishly fast. Nice symbiosis.

    (Yes, this hits my hot button. 🙂 )

    Yes, it make sense to keep the R script on a variable or to load it from a table.

    T.a.

    Iulian

  • Iulian -207023 (10/17/2016)


    Revenant (10/14/2016)


    Steve Jones - SSC Editor (10/14/2016)


    Iulian -207023 (10/13/2016)


    Nice one, but I thought there is a way to pass just the script's name.

    The same way there is catalog for SSIS and a reporting DB for SSRS, it would be nice to be able to create an R library on SQL Server.

    Ta

    Iulian

    The script can be a variable. Putting this separate makes it easier to read.

    This is more flexible than it seems. You can put R script into SQL code and in that R you can call SQL that calls another R script, there is no stated limit how deep you can go.

    You can keep your R scripts in a simple table, and more importantly, you can store your trained models in a table and pass them to R just for evaluation, which is devilishly fast. Nice symbiosis.

    (Yes, this hits my hot button. 🙂 )

    Yes, it make sense to keep the R script on a variable or to load it from a table.

    T.a.

    Iulian

    Very powerful because it sounds like a delegate, treating a function as a variable, sending functions as parameters.

    There is support for this sort of things in T-SQL using EXECUTE, but this R seems to add more functionality through the packages it comes with.

    By the way, what is the execution context for R? Is there a console or something to see what packages are installed or how can I install more packages ?

    T.a.

    Iulian

  • Easy one, thanks.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply