From the course: SQL Server Machine Learning Services: R
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Select values from a data frame
From the course: SQL Server Machine Learning Services: R
Select values from a data frame
- [narrator] Once our data is imported from SQL Server into an R data frame, we can work with individual values using the same single square bracket operator, that we used when working with vectors. The only difference is that vectors are one dimensional, just a single column. The data frame has two dimensions, rows and columns. Let's continue working with the same country data. And I've already got the input data coming from a select query, and the output data set is set up with the schema for the final result. First, I'm going to send the input data right back to the output. On line number four, we can do that by assigning the output data set variable the values directly from the input data set. Make sure you're still targeting the wide world importers database and execute the query. SQL server will fetch the data from the table through the query, pass that information into R, then R copies that data to the output data…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Variables in R6m 10s
-
(Locked)
Import a data set from SQL Server2m 35s
-
(Locked)
Query data into an R data frame4m 51s
-
(Locked)
Output data to a result set5m 24s
-
(Locked)
Select values from a data frame6m 36s
-
(Locked)
Create a data frame from vectors4m 59s
-
(Locked)
Subset a data frame3m 21s
-
(Locked)
Challenge: Import data51s
-
(Locked)
Solution: Import data4m 49s
-
-
-
-
-