I am not sure if any R-specific functionality exists to convert a JPEG image into grayscale. However, writing this functionality yourself would not be difficult.
Assuming that the JPEG image uses the sRGB primaries (it almost certainly does, so don't worry too much about this), the most common conversion function to grayscale is given by the ITU-R reccomendation BT.709 Luma function:
Y' = 0.2126 R' + 0.7152 G' + 0.0722 B'
You can use traditional R techniques to apply this to each spatial location in your image.