我现在有两个数据框,我想在dataframe raw.data列中的industry.fama.french.49列的基础上,在名为industry的数据框section.pos中添加一列,并且它处于条件下doc_id列是raw.data的行号,这意味着在section.pos中doc_id = 1的所有行在新列行业中都应具有2Food值。
我尝试的代码是:
section.1.pos $ industry <-raw.data $ industry.fama.french.49 [as.numeric(row.names(raw.data))== section.1.pos $ doc_id]
我应该如何更改?