Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 使用带有ggplot的两个向量的分位数分位数图_R_Ggplot2_Quantile - Fatal编程技术网

R 使用带有ggplot的两个向量的分位数分位数图

R 使用带有ggplot的两个向量的分位数分位数图,r,ggplot2,quantile,R,Ggplot2,Quantile,我正在寻找使用ggplot2的分位数-分位数图 我有这些数据: model <- c(539.4573, 555.9882, 594.6838, 597.5712, 623.6659, 626.7169, 626.8539, 627.9992, 629.1139, 634.7405, 636.3438, 646.4692, 654.3024, 663.0181, 670.0985, 672.8391, 680.5557, 683.2600, 683.5159, 692.0328, 695.

我正在寻找使用ggplot2的分位数-分位数图

我有这些数据:

model <- c(539.4573, 555.9882, 594.6838, 597.5712, 623.6659, 626.7169, 626.8539, 627.9992, 629.1139, 634.7405, 636.3438, 646.4692, 654.3024, 663.0181, 670.0985, 672.8391, 680.5557, 683.2600, 683.5159, 692.0328, 695.7185, 698.9505, 702.3676, 707.4271, 726.6507, 726.8524, 732.1197, 741.6183, 750.3617, 752.5978, 757.1609, 762.2874, 767.0678, 776.9476, 779.2352, 782.1193, 782.5098, 803.1828, 806.0310,806.0684, 809.3937, 812.8044, 825.6459, 825.6808, 826.4363, 828.0537, 832.3820, 836.0761, 862.7044, 864.1710, 892.0614, 897.7099, 902.7762, 913.0856)

Obs <- c(736.7720, 616.2387, 495.6597, 603.4706, 522.7708, 503.3286, 597.6499, 566.3173, 569.5813, 550.1589, 730.7077, 526.1033, 642.2166, 720.7170, 537.8696, 656.8828, 736.4988, 555.2904, 711.7803, 670.0493, 638.9948, 799.1116, 825.8668, 608.9737, 750.3825, 601.7922, 612.7352, 656.2068, 609.9878, 714.7711, 717.5175, 640.4917, 725.3937, 842.0838, 671.0265, 808.6822, 780.3558, 706.0857, 733.9746, 746.1896, 758.6903, 877.6814, 959.6846, 656.9653, 882.5842, 860.7533, 683.0813, 722.5920, 600.4500, 823.8956, 772.9894, 904.1999, 875.9391, 892.0576)

问题是,我将这些数据放在一个数据框中,包含多个组(例如,我使用相同的模型,但实际上我有三个不同的模型):

有人能帮我吗?

这就是你需要的吗

ggplot() + geom_point(data=df, aes(x=sort(Obs), y=sort(Model))) + xlab('Obs') + ylab('Model')
或者这个

df.ord = do.call('rbind', lapply(split(df, df$type), function(.d) transform(.d, Obs = sort(Obs), Model = sort(Model))))
ggplot() + geom_point(data=df.ord, aes(x=Obs, y=Model, col=type)) + facet_grid(~type)
ggplot(df,aes(Model))+stat_ecdf()+facet_wrap(~type)
p <- ggplot(df)
p <- (p + stat_qq(aes(sample=Model, colour=type)))
print(p)
p <- ggplot(df)
p <- (p + stat_qq(aes(sample=Model, x=Obs, colour=type)))
print(p)
Error : geom_point requires the following missing aesthetics: x
ggplot() + geom_point(data=df, aes(x=sort(Obs), y=sort(Model))) + xlab('Obs') + ylab('Model')
df.ord = do.call('rbind', lapply(split(df, df$type), function(.d) transform(.d, Obs = sort(Obs), Model = sort(Model))))
ggplot() + geom_point(data=df.ord, aes(x=Obs, y=Model, col=type)) + facet_grid(~type)