时间 | Compound_Names |
---|---|
2.105 | 乙醇,2-(乙烯基氧基)--- |
2.490 | 甲氧基乙酸,2-甲基丙基--- |
NA | 酯 |
2.675 | 十六进制--- |
假设您的数据帧名为df
for (i in seq_along(df$Time)){
if(is.na(df$Time[[i]]))
df$Compound_Names[[i-1]] <- paste(df$Compound_Names[[i-1]] ,
df$Compound_Names[[i]] , sep = "---" )
}
df <- na.omit(df)