[英]Performance indices for unequal datasets in R
I wanted to do the performance indices in R. My data looks like this (example): enter image description here我想在 R 中做性能指标。我的数据看起来像这样(示例):在此处输入图像描述
I want to ignore the comparison of values in Time 2 and 4 in data frame 1 and then compare it with the available set of observed data.我想忽略数据帧 1 中时间 2 和 4 中的值的比较,然后将其与可用的观察数据集进行比较。 I know how to develop the equation for the performance indicators (R2, RMSE, IA, etc.), but I am not sure how to ignore the data in the simulated data frame when corresponding observed data is not available for comparison.
我知道如何为性能指标(R2、RMSE、IA 等)制定方程式,但是当相应的观察数据不可用于比较时,我不确定如何忽略模拟数据框中的数据。
Perhaps just do a left join, and compare the columns directly?也许只是做一个左连接,并直接比较列?
library(dplyr)
left_join(d2,d1 %>% rename(simData=Data), by="Time")
Output:输出:
Time Data simData
<dbl> <dbl> <dbl>
1 1 57 52
2 3 88 78
3 5 19 23
Input:输入:
d1 = structure(list(Time = c(1, 2, 3, 4, 5), Data = c(52, 56, 78,
56, 23)), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA,
-5L))
d2 = structure(list(Time = c(1, 3, 5), Data = c(57, 88, 19)), class = c("tbl_df",
"tbl", "data.frame"), row.names = c(NA, -3L))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.