Using the R plot function to create charts is not supported.
You can use the Splunk chart command to create charts which can be displayed in Splunk. That requires to pipe all the required data from the r command to the chart command:
... | r "..." | chart ...
You need to assign a R data frame to a output variable. Look here how to crate a data frame. All data which is assigned to the output variable is piped to the next command. In the above example, that is the chart command.