【发布时间】:2017-11-17 11:37:49
【问题描述】:
我是 R 脚本的新手,不要对我太苛刻:)。
所以我有一个如下所示的 CSV 文件:
Day |Date |Temperature |Pression |Flow
----|-----------|---------------|-----------|------
1 |5/10/2017 |85 |4 |100
2 |5/11/2017 |85 |4.5 |102
3 |5/12/2017 |88 |5.2 |103
4 |5/13/2017 |83 |4.1 |99
.. |..... |.. |... |..
我执行了必要的步骤来导入我的 CSV 数据。
我使用 qcc 函数通过 Xbar 进行质量控制。
我得到了我的图表,但坐标 X 和 Y 是倒置的。 Xbargrap
我希望在 X 坐标中,日期的值具有正确的格式(不是 17300,而是 5-10-2017),而在 Y 坐标中,坐标是压力。
我尝试了几个,但我不能:/
这是我的程序:
# Library
library(qcc)
library(readr)
library(Rserve)
Rserve(args = "--vanilla")
# Data column filter from CSV file imported
Test <- read_csv("C:/Users/..../Desktop/Test.csv",
col_types = cols(Date = col_date(format = "%m/%d/%Y")))
diams <- qcc.groups(Test$Date,Test$Pression)
#diams <- with(Test, qcc.groups(Day, Temperature))
#Background color
qcc.options(bg.margin = "white", bg.figure = "gray95")
#Xbar graph (means of a continuous process variable)
qcc(
data = diams,
type = "xbar",
sizes = 5,
title = "Sample X-bar Chart Title", # Replacement title
digits = 2, # Limit the signifciant figures
plot = TRUE)
你能帮帮我吗?
感谢您的回答。
【问题讨论】: