![]() ![]() ![]() Let’s suppose that we want to help our resellers do better in the Euro region, and we have decided to provide them with different marketing tools for doing that, based on their Annual Sales amount. There are no best solutions, and it all depends on the purpose of the clustering. There are countless ways to do Cluster Analysis, and R provides many libraries which do exactly that. Now let’s do some clustering to dig a bit deeper in our data. R provides useful ways of exploring the functions of the R packages, If, for example, we wanted to list all functions in a specific package we would use a function similar to this: Here is the link to the package page: RODBC: Exploring the functions in a package Note: the R packages are usually available from the CRAN site, and depending on the server setup, they may not be directly accessible from the R environment, but instead it may be needed to be downloaded manually and installed manually. Run the following command: library(RODBC).Run the following command: install.packages(“RODBC”).Open the RStudio console (make sure the R version is at least 3.1.3: If it isn’t, then use the updateR() function).To install and load the RODBC package, do the following: In order to get the connectivity to SQL Server working, first we need to install the packages for the connection method and then we need to load the libraries. Let’s get busy and setup our R environment. For the purpose of this article, however, we will just use the RODBC package There are several options to connect to SQL Server from R and several libraries we can use: RODBC, RJDBC, rsqlserver for example. In this section we will go through some simple examples on how to couple R with SQL Server’s storage engine and thereby read data from, and write data to, SQL Server. This part assumes that the reader has already gained some familiarity with the R environment and has the R and RStudio installed.Īs mentioned, R does not have its own storage engine, but it relies on other systems to store the analyzed data. Of course, aside from the built-in graphics, there are libraries which are more advanced in data presentation (ggplot2, for example) and there are even libraries which enable interactive data exploration.įor more details on R features and on how to install it, refer to the R Basics article, which was recently published on Simple-talk. ![]() An example of this graphical representation will be given shortly. With R it takes couple of lines of code to import data from a data source and only one line of code to display a plot graph of the data distribution. Also, there is a rapidly growing community of developers and data scientists which contribute to the library development and to the methods for exploring data and getting value from it.Īnother great feature is that it has built-in graphical capabilities. It is very modular in that there are many libraries which can be downloaded and used for different purposes. R does not have a storage engine of its own other than the file system, however it uses libraries of drivers to get data from, and send data to, different databases. All operations are performed in memory, which means that it is very fast and flexible as long as there is enough memory available. R is an open source software environment which is used for statistical data analysis. What is R and what noticeable features does it have First I will introduce R as a statistical / analytical language, then I will show how to get data from and to SQL Server, and lastly I will give a simple example of a data analysis with R. In this article I will describe a way to couple SQL Server together with R, and show how we can get a good set of data mining possibilities out of this fusion. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |