你如何检测数据框中的异常

时间:2017-07-26 13:48:42

标签: r

我有一个名为df的数据框,它由JVM和Server提供jvm使用数据。

我需要获取JVM和CPU中使用JVM_CPU异常的列表。

    dput(df)
structure(list(Date = structure(c(1L, 1L, 1L, 1L, 1L, 2L, 2L, 
2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L), .Label = c("7/24/2017 15:01", 
"7/24/2017 15:02", "7/24/2017 15:03", "7/24/2017 15:04"), class = "factor"), 
    Server = structure(c(1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 
    5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L), .Label = c("server1", 
    "server2", "server3", "server4", "server5"), class = "factor"), 
    JVM = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = "jvm1", class = "factor"), 
    JVM_CPU = c(90, 0.25, 3.1, 1.2, 30, 0.3, 0.15, 0.1, 0.1, 
    8.8, 88, 4.2, 0.35, 0.15, 60, 2.2, 0.2, 0.15, 0.1, 0.15), 
    JVM_Mem_Percent = c(3.33, 2.48, 27.09, 19.9, 3.04, 2.12, 
    6.67, 2.43, 1.15, 41.2, 4.32, 25.37, 3.42, 2.59, 27.64, 18.01, 
    3.11, 2.24, 6.73, 2.53), JVM_Resp = c(NA, NA, 5.86, 3.61, 
    NA, NA, NA, NA, NA, 9.06, NA, 5.22, NA, NA, 1.02, 3.55, NA, 
    NA, NA, NA), JVM_Mem = c(88.72, 66.23, 722.53, 530.57, 81.17, 
    56.44, 177.79, 64.8, 30.58, 1098.59, 115.1, 676.48, 91.25, 
    68.95, 737.11, 480.28, 82.98, 59.67, 179.38, 67.36)), .Names = c("Date", 
"Server", "JVM", "JVM_CPU", "JVM_Mem_Percent", "JVM_Resp", "JVM_Mem"
), class = "data.frame", row.names = c(NA, -20L))

当我这样做时:

ggplot(df,aes(JVM,JVM_CPU))+ geom_boxplot()+ facet_wrap(~Server)

我可以看到异常,但我需要服务器和JVM具有数据帧格式的异常。例如,

Server  JVM
Server1 JVM1

如何从boxplot.stats输出中提取它?

0 个答案:

没有答案