One of the most popular packages for data preparation in R is the dplyr package. The package brings a very consistent, simple, readable, and efficient syntax. You work on data with functions that are somewhat mimicking SQL expressions. Let me start this quick introduction with a projection on a dataset. You do this with the select() function of the dplyr package. But before that, I am reading slightly different data from SQL Server than I did before, because I want to have the country of the customer also in my data frame:
con <- odbcConnect("AWDW", uid = "RUser", pwd = "Pa$$w0rd")TM <- as.data.frame(sqlQuery(con, "SELECT c.CustomerKey, g.EnglishCountryRegionName AS Country, c.EnglishEducation AS Education, c.YearlyIncome ...