简体   繁体   English

如何修复 r markdown 中的矩阵错误问题?

[英]how to fix matrix error Issue in r markdown?

Rmarkdown keeps telling me this whenever I try to load r file: Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'as.matrix': cannot open the connection每当我尝试加载 r 文件时,Rmarkdown 一直告诉我这个:h(simpleError(msg, call)) 中的错误:在为函数“as.matrix”选择方法时评估参数“x”时出错:无法打开连接

this is what the r file contains:这是 r 文件包含的内容:

a <- as.matrix(read.csv("data/a_a.csv", row.names = 1))
b  <- as.matrix(read.csv("data/b_b.csv" , row.names = 1))

In the R file, you would want to show the entire path example: a <- as.matrix(read.csv("project/R/data/a_a.csv", row.names = 1)).在 R 文件中,您可能希望显示整个路径示例:a <- as.matrix(read.csv("project/R/data/a_a.csv", row.names = 1))。 when you load it into Rmarkdown, it will be able to read it.当你将它加载到 Rmarkdown 中时,它将能够读取它。

Thanks!谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM