Publications by tomaztsql
First release and update dates of R Packages statistics
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
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
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
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
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
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
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
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
Advent of Code 2019 challenge with R
I have decided to tackle this year’s Advent Of Code using R (more or less). I know there are more preferred languages, such as Python, C#, Java, JavaScript, Go, Kotlin, C++, Elixir, but it was worth trying. Into the 8th day of the competition, in the time of writing this blog post, I have had little problems using R. There was a competition on ...
1898 sym R (5308 sym/4 pcs) 6 img
Working with Windows CMD system commands in R
From time to time, when developing in R, working and wrangling data , preparing for machine learning projects, it comes the time, one would still need to access the operating system commands from/in R. In this blog post, let’s take a look at some most useful cmd commands when using R. Please note, that the cmd commands apply only to windows e...
6176 sym R (3532 sym/22 pcs) 16 img