Issue link: http://hub-nl.insight.com/i/692679
114 C H A P T E R 6 | More analytics
R Services (Standalone) This component adds the R packages and connectivity tools necessary
to develop R solutions and downloads and installs MRO.
An R integrated development environment (IDE) You can use any R IDE that you prefer.
Getting started with R Services
Although you execute your R code and run computations on SQL Server, you develop and test by
using an R IDE of your choice. In this section, we describe how to prepare your data for exploration
with R functions, how to build and use a predictive model, and how to test the accuracy of your
model.
Note The examples in this chapter are derived from "Data Science End-to-End Walkthrough,"
available at https://msdn.microsoft.com/en-US/library/mt612857.aspx, which includes additional
topics about working with R and provides a PowerShell script you can download and use to prepare
the data set used in the examples. This data set contains public data about New York City taxi fares,
passenger counts, pickup and drop-off locations, and whether a tip was given.
You can also learn more about working with R Services in "Data Science Deep Dive: Using the
RevoScaleR Packages" at https://msdn.microsoft.com/en-US
/library/mt637368.aspx.
Compute context
Before you can execute R on your data, you must use the RxSetComputeContext function in the R IDE
to set the compute context for functions in the RevoScaleR package in RRE to run on SQL Server.
Although you can use a single line of code to run this command, you can assign values to variables in
separate lines of code and then use the variables as arguments to the function, as shown in Example
6-3.
Example 6-3: Setting compute context to SQL Server
connStr <- "Driver=SQL Server; Server=