0
我是新來這個網站很抱歉,如果這個職位是蹩腳的。使數據幀中的一個新的變量/列具有一定的質量從現有的數據幀
我正在從一個海量數據文件中工作,所以我將給出一個它看起來像here的小例子。
在這個數據文件中,「plate」列有三個值:1,2和3.我試圖創建三個新列,每列具有特定行的「Abs.530nm」值if它包含了相應的車牌號碼(例如從板1的吸光度值分隔成一個新列等)
這就是我試圖做:
data.row$plate %<>% factor(levels = c("1","2","3"))
data.row %>%
group_by(box, plate) %>%
diff.tr.1.2 <- subset(plate, name.start <-"1", drop=FALSE) %>%
{.} ->data.tech
我得到這個錯誤:
Error in subset(plate, name.start <- "1", drop = FALSE) :
object 'plate' not found
有沒有辦法做我想做的事?
您正在使用'基地R'語法與'dplyr'一起。我認爲你需要'data.row%>%GROUP_BY(箱,板=因子(板,水平= 1:3))%>%的過濾器(name.start == 1)''的部分subset'目前尚不清楚。你的意思是'name.start == 1' – akrun