R 显示来自矩阵/数据框的数据,但不显示列名或行名

R show data from matrix/ dataframe but not the column or row names

我在 r(或数据框)中有一个矩阵,我想显示数据但没有列名。

这是因为包含的数据将是 word 降价的一部分,因此只有我在 table 中拥有的数据是相关的。

最后的objective是将r-script生成的包含的数据带入markdown文档。

Table 示例:

df<-matrix(c("Name: John Doe", "Country: USA", "State: IL","Role: Consultant","Company: Microsoft","University: NYU"),ncol=2,byrow=TRUE)

关于如何显示数据而不是 column/row 标题的任何想法

尝试 cat:

cat(df, sep = "\n")

输出:

Name: John Doe
State: IL
Company: Microsoft
Country: USA
Role: Consultant
University: NYU