3
我想創建一個基於現有列新列,但高於創建於現有列新列的基礎,但行上方
一排開始:
df <- data.frame(a=c(1:10), b=c("red", "yellow", "blue", "green", "yellow", "purple", "blue", "green", "yellow", "purple"))
有了結果看起來像:
df <- data.frame(a=c(1:10), b=c("red", "yellow", "blue", "green", "yellow", "purple", "blue", "green", "yellow", "purple"), c=c("na", "red", "yellow", "blue", "green", "yellow", "purple", "blue", "green", "yellow"))
感謝您的幫助,您能提供