Articles by kjytay

What is a sunflower plot?

February 4, 2021 | kjytay

A sunflower plot is a type of scatterplot which tries to reduce overplotting. When there are multiple points that have the same (x, y) values, sunflower plots plot just one point there, but has little edges (or “petals”) coming out … Continue reading →
[Read more...]

covidcast package for COVID-19-related data

January 21, 2021 | kjytay

(This is a PSA post, where I share a package that I think that might be of interest to the community but I haven’t looked too deeply into myself.) Today I learnt of the covidcast R package, which provides access … Continue reading →
[Read more...]

The Mendoza line

January 20, 2021 | kjytay

The Mendoza Line is a term from baseball. Named after Mario Mendoza, it refers to the threshold of incompetent hitting. It is frequently taken to be a batting average of .200, although all the sources I looked at made sure … Continue reading →
[Read more...]

A shiny app for exploratory data analysis

December 22, 2020 | kjytay

I recently learnt how to build basic R Shiny apps. To practice using Shiny, I created a simple app that you can use to perform simple exploratory data analysis. You can use the app here to play around with the … Continue reading →
[Read more...]

Some notes when using dot-dot-dot (…) in R

November 14, 2020 | kjytay

When writing functions R, the ... argument is a special argument useful for passing an unknown number of arguments to another function. This is widely used in R, especially in generic functions such as plot(), print(), and apply(). Hadley Wickham’s … Continue reading → [Read more...]

Attributes in R

October 19, 2020 | kjytay

In R, objects are allowed to have attributes, which is a way for users to tag additional information to an R object. There are a few reasons why one might want to use attributes. One reason that I encountered recently … Continue reading → [Read more...]

Simulating paths from a random walk

September 9, 2020 | kjytay

If you’ve ever visited this blog at, you might have noticed a header image that looks like this: Ever wonder how it was generated? The image depicts 100 simulations of an asymmetric random walk. In this post, I’ll go … Continue reading →
[Read more...]

NBA salaries

August 28, 2020 | kjytay

I came across a dataset of NBA player salaries from the 1984-1985 season to the 2017-2018 season here, and I thought it would be a fun dataset to practice my tidyverse skills on. All the code for this post can … Continue reading →
[Read more...]

Basic manipulation of GIF frames with magick

August 6, 2020 | kjytay

The magick package is a really powerful package for image processing in R. The official vignette is a great place to start learning how to use the package. I’ve been playing around with using magick for manipulating GIFs and found … Continue reading → [Read more...]

Image contours in R

August 5, 2020 | kjytay

I recently came across this short fun post on R-bloggers that demonstrated how to use the image.ContourDetector package (available on CRAN) to extract contours from an image. The image of the contours looked really cool so I thought I would … Continue reading →
[Read more...]

What is nearly-isotonic regression?

May 26, 2020 | kjytay

Let’s say we have data such that . (We assume no ties among the ‘s for simplicity.) Isotonic regression gives us a monotonic fit for the ‘s by solving the problem (See this previous post for more details.) Nearly-isotonic regression, … Continue reading →
[Read more...]

What is isotonic regression?

May 24, 2020 | kjytay

Isotonic regression is a method for obtaining a monotonic fit for 1-dimensional data. Let’s say we have data such that . (We assume no ties among the ‘s for simplicity.) Informally, isotonic regression looks for such that the ‘s approximate … Continue reading →
[Read more...]

glmnet v4.0: generalizing the family parameter

May 14, 2020 | kjytay

I’ve had the privilege of working with Trevor Hastie on an extension of the glmnet package which has just been released. In essence, the glmnet() function’s family parameter can now be any object of class family. This enables the user … Continue reading →
[Read more...]
1 2 3 4 5

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)