r scripted and chart output to png