Commands

library(ShortRead)
seq <- readFastq("a.fq")
primer <- "GGA"
trimmed <- trimLRPatterns(Lpattern=Primer,subject=sread(seq),Lfixed="subject")

References

http://bioconductor.org/packages/release/bioc/html/ShortRead.html