The library 'seewave' is the classic tool for making oscillogram and spectrogram figures using R. But these figures can also be done using the library 'dynaSpec' and 'ggplot2' to get slightly different results. See for example this figure from Muñoz et al., (2025):
You can make similar figures using the code below: