Unfortunately they crippled the Wemos D1 R1 board settings, so you have to select "Generic ESP8266 Module" board to get the Crystal Frequency setting.
OR (if you feel confident) add following lines to the d1 r1 section of your boards.txt
d1.menu.CrystalFreq.26=26 MHz
d1.menu.CrystalFreq.40=40 MHz
d1.menu.CrystalFreq.40.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266