Publications by tomaztsql
Little useless-useful R functions – How to make R-squared useless
Uselessness is such a long useless word! In statistics, R-squared is a statistical measure, that determines the proportion of variance in dependent variable that can be explained by the independent variable. Therefore, it ranges in value from 0 to 1 and is usually interpreted as summarizing the percent of variation in the response that the regre...
1966 sym R (502 sym/3 pcs) 2 img
Little useless-useful R functions – Function for faster reading with Bionic Reading
Trick your brain into faster reading with the help of Bionic Reading. With the help of highlighting part of the words, it “guides your eyes over the text and the brain remembers previously learned words more quickly.” (source: br-about) Here is a beautiful example of how text with the use of opacity, colours, size and many other elements can b...
1734 sym R (1285 sym/3 pcs) 4 img
Little useless-useful R functions – Continuous, nowhere differentiable Weierstrass function
Coming from the simple sine function (remember of Fourier series), German xs <- seq(-2*pi,2*pi,pi/100) plot(xs,sin(2*xs),type="l",ylim=c(-1,1)); abline(h=0,lty=3) mathematician Karl Weierstrass became the first to publish an example of a continuous, nowheredifferentiable function. Weierstrass function (originally defined as a Fourier series) was...
1400 sym R (388 sym/2 pcs) 6 img
Little useless-useful R functions – Return matrix elements in spiral order
Another one from the Leetcode challenge. This time, get the elements (single values) from the matrix in a spiral order with a starting position of [1,1]. So, the basic idea is to retrieve a vector of elements from a matrix in the following order: In this order, we get the vector with the following elements: So, we need to create the boundaries, c...
1068 sym Python (1083 sym/1 pcs) 4 img
Little useless-useful R functions – Goldbach’s conjecture and Sieve of Sundaram
This is fun It is also O(MAX) complexity. But first some background. Since the problem is super old, we are not intending to solve it, merely to play with it. In the number theory of mathematics, the Goldbach’s conjecture states that for every even integer (greater than 2) can be expressed with the sum of two prime numbers. There are also far cr...
1743 sym R (1329 sym/3 pcs) 8 img
datasetR – R package for creating datasets
The datasetR helps you generate a random datasets for your R project. It provides a preset random list of values with different data types (interval, ordinal, nominal values). It includes also a function for imputing a NULL, NA or missing values. Installing the package datasetR package can be installed and downloaded from this Github repository ...
3505 sym R (368 sym/6 pcs) 2 img
“Climate spiral” – Plotting GISS Surface Temperature
NASA has been collecting surface temperature for more than over 100 years, and the GISS Surface Temperature analysis from 1888 onward. It is an estimate of global surface temperature change. The temperature analysis schema was defined in the late 1970s by James Hansen and the complete analysis and method are documented in Hansen and Lebedeff (1987...
1747 sym R (1454 sym/2 pcs) 10 img
Little useless-useful R functions – Old phone converted from text to numbers
We all remember this, right? What a nightmare was to type a short message on these keypads. So, image writing Hello on this keypad, you had to press: 4433555555666 to get the letters “hello”. 44 = h33 = e555 = l555 = l 666 = o So creating converter would be great to troll on your friends By using this useless function, you can now convert te...
1670 sym R (923 sym/2 pcs) 4 img
T-SQL Tuesday #162 Invitation – Data Science in the time of ChatGPT
This is a great opportunity and I am honoured to be hosting this months T-SQL Tuesday blogging invitation. With the invitation of Steve, we have agreed to post topic on Data science. I will be receiving all of your answers on blog posts and twitter (make sure to add #tsql2sday). Data Science in the time of Chat GPT Instead of writing and asking Da...
5413 sym 2 img
Little useless-useful R functions – Transforming dataframe to markdown table
Writing markdown documents outside RStudio (using the usual set of packages) has benefits and struggles. Huge struggle is transforming dataframe results into markdown table, using hypens and pipes. Ugghhh… This useless functions takes R dataframe as input and prints out dataframe wrapped in markdown table. iris[1:3,1:5] # Result: #> Sepal.Length ...
1201 sym R (1123 sym/3 pcs) 4 img