Profiling dataframes in R

We will revisit the same dataset from Chapter 4, Creating Bar Charts with D3.js; however, this time it will be retrieved using a SQL statement as opposed to a CSV file. The following SQL statement will return the same data for discount codes by week:

SELECT [WeekInYear] 
       ,[DiscountCode] 
   FROM [AdventureWorks2014].[dbo].[DiscountCodebyWeek] 

We can incorporate this same SQL statement inside of a dataframe within R by using the following script:

SQL_Query_1<-sqlQuery(connection_SQLBI,
            'SELECT [WeekInYear]
            ,[DiscountCode]
            FROM [AdventureWorks2014].[dbo].[DiscountCodebyWeek]' )

A dataframe is merely a dataset organized by columns, and the simplest way to get the results of a dataframe is to execute the following script, which will ...

Get Practical Business Intelligence now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.