相关疑难解决方法(0)

R:填写多列

我正在使用tidyr包中的fill().fill(df,colname1,colname2,colname3)工作正常,直到我找到一个包含32个变量的数据集.如何在不键入每个名称的情况下填写所有列?

我试过了:

fill(df,colnames(df)),
fill(df,1:32), 
fill(df,colname1:colname32). 
Run Code Online (Sandbox Code Playgroud)

并产生以下错误:

Error: All select() inputs must resolve to integer column positions.
The following do not:
*  colnames(df1)

Error: tinyformat: Not enough conversion specifiers in format string

Error: tinyformat: Not enough conversion specifiers in format string
Run Code Online (Sandbox Code Playgroud)

r fill tidyr

3
推荐指数
1
解决办法
3031
查看次数

标签 统计

fill ×1

r ×1

tidyr ×1