在R中打印没有索引的字符串[重复]

时间:2022-02-11 21:38:47

This question already has an answer here:

这个问题已经有了答案:

I have looked at the answers to Print list without line numbers in R and Prevent print() from outputting list indices in R, but neither seems to prevent R from printing a character string with indices are the left.

我查看了在R中没有行号的打印列表的答案,并阻止Print()在R中输出列表索引,但似乎都不能阻止R打印带有索引的字符串。

Input:

输入:

foo = "10 & 1.832171"    
print(foo, row.names=F, quote=F)  

Output:

输出:

[1] 10 & 1.832171

Desired Output:

期望的输出:

 10 & 1.832171

Is this possible at all?

这可能吗?

1 个解决方案

#1


20  

> foo = "10 & 1.832171"       
> cat(foo)
10 & 1.832171

#1


20  

> foo = "10 & 1.832171"       
> cat(foo)
10 & 1.832171