【问题标题】:Error number of columns of result is not a multiple of vector length (arg 1) in R [closed]结果的错误列数不是R中向量长度(arg 1)的倍数[关闭]
【发布时间】:2021-11-17 00:54:22
【问题描述】:

我在尝试执行以下代码时遇到了上面的错误信息错误

Nome_Dos_Formadores <- rbind(V_Nome_Dos_Formadores$`Nome do Formador`, N_Nome_Dos_Formadores$`Nome do Formador`)

你能帮我解决这个错误吗?

【问题讨论】:

  • 信息不足。我们需要在这些数据帧上查看str 的结果才能知道。为什么你只给rbind 提供向量。通常人们会给出矩阵或数据框。也许你真的想要:Nome_Dos_Formadores <- rbind(V_Nome_Dos_Formadores, N_Nome_Dos_Formadores)
  • @IRTFM 这是正确的解决方案。你能用这段文字回答,然后我可以接受它作为解决方案吗?谢谢。

标签: r rbind


【解决方案1】:

我们需要在这些数据帧上查看 str 的结果才能确定。您的代码仅将向量提供给 rbind。通常人们会希望将rbind 用于矩阵或数据帧。也许你真的想要:

Nome_Dos_Formadores <- rbind(V_Nome_Dos_Formadores, N_Nome_Dos_Formadores)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-11-08
    • 2018-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多