我有如下所示的样本数据。
我使用以下代码来插值指定
Die Device Id Vg W L
1 Device1 1 0 10 1
1 Device1 1.2 0.1 10 1
1 Device1 1.3 0.2 10 1
1 Device2 1 0 10 2
1 Device2 1.2 0.1 10 2
1 Device2 1.3 0.2 10 2
1 Device3 1 0 10 3
1 Device3 1.2 0.1 10 3
1 Device3 1.3 0.2 10 3
data_tidy <- structure(list(Die = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), Device = c("Device1",
"Device1", "Device1", "Device2", "Device2", "Device2", "Device3",
"Device3", "Device3"), Id = c(1, 1.2, 1.3, 1, 1.2, 1.3, 1, 1.2,
1.3), Vg = c(0, 0.1, 0.2, 0, 0.1, 0.2, 0, 0.1, 0.2), W = c(10L,
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L), L = c(1L, 1L, 1L, 2L,
2L, 2L, 3L, 3L, 3L)), .Names = c("Die", "Device", "Id", "Vg",
"W", "L"), class = "data.frame", row.names = c(NA, -9L))
我使用以下代码来插值指定
Id
时Vg
的值。data_tidy %>% group_by(Die,Device) %>%
mutate(Vt=approx(x=log10(Id), y=Vg, xout=log10(3e-8*W/L))$y)
我收到一个错误提示:
错误:无效下标类型“double”
我很惊讶,因为几天前我能够编译这段代码而没有任何错误。我还在论坛上讨论了这段代码(链接)。我不确定问题出在哪里。任何帮助将不胜感激。