【发布时间】:2021-08-30 17:03:12
【问题描述】:
我有以下两个data.frame。我想从D1 中获取Grade 并分配给D 中的Pts。操作完成后,Ddata.frame 应该有 Pts、Val 和 Grade 的列,没有 C 或 Good Grade。
D <- data.frame(Pts= c("A","B","D"), Val = c(3.5,4,5))
D1 = data.frame(Pts = c("A","B","C", "D"), Grade = c("Ugly", "Bad", "Good", "Excellent"))
D$Grade <- D1$Grade
【问题讨论】:
标签: r dataframe tags reshape assign