When I try to install mlr package, I get this error message
Package which is only available in source form, and may need compilation of C/C++/Fortran:
‘mlr’
These will not be installed
Your issue happened once to me, if I remember right, you need Rtools as others have said. Notice, though, Rtools is not a package, it's an official maintained package-building application.
You must download it from the release page: Building R for Windows.
This is most likely a problem with the cran mirror that you are using . You can try picking one of the mirrors from https://cran.r-project.org/mirrors.html and install the package from a specific repo .
Example :
install.packages('mlr', repo='http://cran.fiocruz.br/')
The full list of repos can be found at https://cran.r-project.org/mirrors.html . You can try picking a few repos to see which one works .