Hi,
I was able to fix the issue thanks to your post. So, I did warnings() and I got this message:
Warning messages:
1: In grDevices:::png("/tmp/Rtmp700CWS/59baa711a2fb4bb48fc3ff4cdb6c579d.png", ... :
unable to load shared object '/usr/local/lib/R/library/grDevices/libs//cairo.so':
/usr/local/lib/R/library/grDevices/libs//cairo.so: cannot open shared object file: No such file or directory
2: In grDevices:::png("/tmp/Rtmp700CWS/59baa711a2fb4bb48fc3ff4cdb6c579d.png", ... :
failed to load cairo DLL
I looked in /usr/local/lib/R/library/grDevices/libs and did not find cairo.so but there was one in the /opt directory so I created a soft link
sudo ln -s /opt/R/3.5.1/lib/R/library/grDevices/libs/cairo.so cairo.so
and plots are working fine. I missed this earlier, because it gave 50 warnings and since the last 15 or so looked similar, I didnt scroll up to see the first one, assuming that they were all the same.
Thanks a lot kevinushey and EconomiCurtis for your help.
-S