Have a look at the Biostrings package, function matchPWM. Scanning the whole genome is possibly not an effective strategy though, due to large number of false positives, even if it might work in R with a large RAM machine (not sure about it, might work for you or not). You should maybe focus on promoter regions. See also this documentation for a workflow: