Why are un-requested packages removed (docker build)?

So, I’m building my docker with the following Dockerfile

# dummy base, which contains R

ARG KING_URL="http://people.virginia.edu/~wc9c/KING/executables/Linux-king215.tar.gz"
ARG PLINK2_URL="https://github.com/chrchang/plink-ng/releases/download/2019/plink2_linux_x86_64_20190107.zip"
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get -qqy update --fix-missing && 
    apt-get -qqy dist-upgrade && 
    apt-get -qqy install --no-install-recommends 
                 wget unzip && 
    cd /tmp && 
    wget -q ${KING_URL} && 
    tar -xzf Linux-king215.tar.gz -C /usr/local/bin && 
    wget -q ${PLINK2_URL} && 
    unzip plink2_linux_x86_64_20190107.zip -d /usr/local/bin && 
    cd -- && 
    apt-get -qqy remove wget unzip && 
    rm -rf /tmp/* 

However, this seems to remove R, unless I explicitly remove the line apt-get -qqy remove wget unzip.

I’m having difficulty understanding why. Help much appreciated!

Source: StackOverflow