How to Copy a DS Game Cartridge Onto an R4

Team Cyclops, the group behind the CycloneDS, published a walkthrough for exactly this. The method uses the console's wireless connection to send the game data from the cartridge to your PC over Wi-Fi, after which you copy the resulting file across to your R4's memory card in the usual way.

Do this only with games you own. Ripping and distributing copies of games you have not bought is straightforwardly illegal, whatever the guide says.