如何从Column Filter(R / Knime)中选择R曲线的坐标X和Y?

时间:2017-06-29 05:22:25

标签: r knime

所以,我有这个工作流程:

enter image description here enter image description here

我使用“列过滤器”从我的文件中选择了2列(日和温度)。我连接到我配置的'R plot',但我得到了这个:

enter image description here

未将日期列选为X轴,但(行ID)和Y轴正常。

这是我在R情节中的代码:

# Library
library(qcc)
library(readr)
library(Rserve)
Rserve(args = "--vanilla")

# Data column filter from CSV file imported
Test <- kIn

#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)

1 个答案:

答案 0 :(得分:0)

这是我的尝试(使用KNIME的R,而不是社区贡献):

#install.packages("qcc")
library(qcc)

data <- knime.in
#Change the names to use Day instead of row keys
row.names(data) <- data$Day

#Using the updated data
plot(qcc(data = data,
    type = "R",
    sizes = 5,
    title = "Sample R Chart Title",
    digits = 2,
    plot = TRUE))

结果如:

plot using R view

如果要选择X轴的列,只需更改row.names分配。 (如果列名来自流变量,它也可以来自knime.flow.in,但据我所知,情况并非如此。)