: warning : The `x` argument of `as_tibble.matrix()` must have unique column names if `.name_repair` is omitted as of tibble 2. 0.0

标签 r

umap_results$layout
  #         [,1]         [,2]
  #[1,] -1.041482307  1.389173771
  #[2,]  0.686965089  2.671049064
  #[3,] -2.170222731 -0.347427768
  #[4,] -2.028087128  2.476267251
  #[5,] -1.070957496 -0.354622580
  #[6,] -1.174079325 -1.174164172
  #[7,] -2.777973062  2.372981619
  #[8,] -1.237910856  0.798519857
  #[9,] -1.551065808  1.186282879
  #[10,] -2.686569147  2.606249490

umap_results_tbl <- umap_results$layout %>%
  as_tibble()%>%
  mutate(symbol = stock_date_matrix_tbl$symbol)

#symbol is just a simple column with alphabets e.g. symbol = #c(A,AL,AP)

我不明白为什么错误告诉我输入唯一列,而我确实给出了唯一列(布局)。能解释一下原因吗?

最佳答案

这只是一个警告。当对象输入是一个矩阵且没有任何列名称时,会发出警告。

library(tibble)
cbind(1:5, 6:10) %>% 
        as_tibble()

如果我们使用.name_repair,则有一个选项可以覆盖警告,并且默认情况下它使用选项check_unique

cbind(1:5, 6:10) %>%
     as_tibble(.name_repair = 'unique')

关于: warning : The `x` argument of `as_tibble.matrix()` must have unique column names if `.name_repair` is omitted as of tibble 2. 0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65256428/

相关文章:

ios - 在iPhone 5/iPad第4代上安装R(统计计算项目)(ARM v7s指令集)

r - 提取第一个和第二个空格之间的字符串

R:使用函数将新列添加到数据框

r - .pointsToMatrix(x) : longitude > 360 with calculating distance 中的错误

R:按年龄计算风险时间

r - Sparklyr - 无法实例化 SessionHiveMetaStoreClient

r - 在 R 中,如何制作一个六条形图,其中每个条形包含一系列数据?

r - 将阿拉伯文本分配给 R 变量

r - 如何以 sqrt(x) 格式格式化 x 轴刻度标签?

r - 维恩图(4套)带R : problem with percentages