Publications by tomaztsql

Real-time data visualization using R and data extracting from SQL Server

23.07.2018

In the previous post, I have showed how to visualize near real-time data using Python and Dash module.  And it is time to see one of the many ways, how to do it in R. This time, I will not use any additional frames for visualization, like shiny, plotly or any others others, but will simply use base R functions and RODBC package to extract data f...

1824 sym R (1715 sym/6 pcs) 4 img

SQL Server 2017 Machine Learning services with R book

06.08.2018

Yes, I am finally blogging this. This blog post is slighty different, since it brings you the tittle of the book, that my dear friend Julie Koesmarno (blog | twitter) and I have written in and it was published in March 2018 at Packt Publishing. Book covers the aspect of the R Machine Learning services available in Microsoft SQL Server 2017 (and...

2772 sym 4 img

First release and update dates of R Packages statistics

07.10.2018

R has been around long time and the packages have evolved through the years as well. From the initial releases, updates, to new packages. Like many open-source and community driven languages, R is not an exception. And getting the first release dates of R packages requires little bit of web scrapping and lots of fun. CRAN – Comprehensive R Arch...

3932 sym R (4050 sym/12 pcs) 10 img

Running R scripts within in-database SQL Server Machine Learning

14.10.2018

Having all the R functions, all libraries and any kind of definitions (URL, links, working directories, environments, memory, etc) in one file is nothing new, but sometimes a lifesaver. Using R function source is the function to achieve this. Storing all definitions, functions, classes on one place can help enterprises achieve faster installation...

2736 sym R (657 sym/4 pcs) 6 img

Window Aggregate operator in batch mode in SQL Server 2019

18.01.2019

So this came as a surprise, when working on calculating simple statistics on my dataset, in particular min, max and median. First two are trivial. The last one was the one, that caught my attention. While finding the fastest way on calculating the median (statistic: median) for given dataset, I have stumbled upon an interesting thing.  While WIN...

3263 sym R (1641 sym/6 pcs) 10 img

Installing R using Powershell

18.02.2019

Installing R from scratch and creating your favorite IDE setup is especially useful when making fresh installation or when you are developing and testing out different versions. This blogpost will guide you through some essential steps (hopefully, there will not be many) on how to download the desired R engine, desired R GUI – in this case RStu...

3548 sym R (3046 sym/7 pcs) 12 img

Number 6174 or Kaprekar constant in R

20.02.2019

Not always is the answer 42 as explained in Hitchhiker’s guide. Sometimes it is also 6174. Kaprekar number is one of those gems, that makes Mathematics fun. Indian recreational mathematician D.R.Kaprekar, found number 6174 – also known as Kaprekar constant – that will return the subtraction result when following this rules:  Take any fou...

2503 sym R (2552 sym/9 pcs) 14 img

Creating data frame using structure() function in R

27.05.2019

Structure() function is a simple, yet powerful function that describes a given object with given attributes. It is part of base R language library, so there is no need to load any additional library. And also, since the function was part of S-Language, it is in the base library from the earlier versions, making it backward or forward compatible. ...

2114 sym R (1535 sym/9 pcs) 2 img

Finding duplicates in data frame across columns and replacing them with unique values using R

05.08.2019

Suppose you have a dataset with many variables, and you want to check: if there are any duplicated for each of the observation replace duplicates with random value from pool of existing values. In this manner, let’s create a sample dataset: df <- structure(list( v1 = c(10,20,30,40,50,60,70,80) ,v2 = c(5,7,6,8,6,8,9,4) ,v3 = c(2,4,6,6,7...

1533 sym R (921 sym/3 pcs) 8 img

Hangman game with R

19.11.2019

Hangman is a classic word game in which you need to need to guess as many possible letters in word, so you can guess the word, before running out of tries (lives). Upon running out of tries, you are hanged! The game can be played in R Studio, where the user inputs new letters in console, and the picture is being drawn (using library ggplot2). Th...

1331 sym R (1293 sym/3 pcs) 8 img