Netherlands: Software

Introductie van Micorosoft SQL Server 2016

Issue link: http://hub-nl.insight.com/i/692679

Contents of this Issue

Navigation

Page 128 of 212

116 C H A P T E R 6 | More analytics Note You can replace the sqlQuery argument with the table argument if you prefer to reference an entire table. You cannot use both arguments together. Tip The sample data in this section does not contain categorical data. When your data contains categories, such as age groups or geographic regions, you should consider including the stringsAsFactors argument with the RxSqlServerData function. This argument is a Boolean value that controls whether to convert strings to factors. A factor is an R object type that is used in statistical functions. Functions such as rxSummary return more complete results for factors as compared to strings. Data exploration After creating a data source, you can use statistical functions or create plots and graphic objects with which to explore your data in the R IDE. A good starting point is the rxGetVarInfo function to display basic information about the structure of your data source. To do this, use the following code in your R IDE: rxGetVarInfo(data = inDataSource) Executing this code returns the results shown in Figure 6-15. The rxGetVarInfo function returns metadata about the columns of your data, which are called variables when working in R. The metadata includes the name and data type for each variable. Figure 6-15: Executing the rxGetVarInfo function in the R console. Another common function to use for becoming familiar with your data is rxSummary. For a basic statistical summary of your data, as shown in Figure 6-16, use the following code: rxSummary(~., data = inDataSource) Figure 6-16: Executing the rxSummary function in the R console.

Articles in this issue

Archives of this issue

view archives of Netherlands: Software - Introductie van Micorosoft SQL Server 2016