How I can extract data from R plot (Rstudio/KNIME)?

Hi everybody !

As it’s writing on title, I would like to extract a specific data from R plot.

On my program, I use the qcc function with control chart R (It’s Quality Control).

  #Background color  qcc.options(bg.margin = "white", bg.figure = "gray95")
  #R graph ranges of a continuous process variable
  qcc(data = Test,
      type = "R",
      sizes = 5,
      title = "Sample R Chart Title",
      digits = 2,
      plot = TRUE)

And I obtained this R plot:

 

I would like to extract the point which is out of control and the data below the plot.

Can you help me?

Thank you for your answers.

Hi Robunle!

I have never used the qcc function before and it's not really KNIME related, so take all of this with a grain of salt, but it may help anyway:
 

The documentation (https://cran.r-project.org/web/packages/qcc/qcc.pdf) shows you can pass retrieve the result object into a new variable with which you should be able to get all of those values pretty easily:

 

#R graph ranges of a continuous process variable
result <- qcc(data = Test,
    type = "R",
    sizes = 5,
    title = "Sample R Chart Title",
    digits = 2,
    plot = TRUE)

# This will hopefully print some of the values which are also displayed in the chart
print(result$statistics)

Hope that helps somehow.
Cheers, Jonathan

Use "Table to R" to send Knime data to R & do the qcc calculation; then use "R View (workspace)" to get the plot, and "R to Table" to export your qcc results from R, it will be something like (although I haven't tried it?!):

"R View (workspace)" :

plot(result)

and "R to Table":

knime.out <- data.frame(result$statistics)

"Table to R":

your current script.

Cheers,

Steve.