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

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

# dummy base, which contains R
ARG MY_BASE_IMAGE=r-base
FROM ${MY_BASE_IMAGE}

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/* 
           /var/tmp/* 
           /var/cache/apt/* 
           /var/lib/apt/lists/* 
           /usr/share/man/?? 
           /usr/share/man/??_*

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