是双“"和单''引号(总是)在R中可以互换吗? [英] Are double "" and single '' quotes (always) interchangeable in R?

查看:128
本文介绍了是双“"和单''引号(总是)在R中可以互换吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这也许是个小问题...

This is perhaps rather a minor question...

但是不久前,我正在浏览我编写的一些代码,发现我倾向于完全互换地使用="something"='something_else',通常是在同一函数中使用.

but just a moment ago I was looking through some code I had written and noticed that I tend to just use ="something" and ='something_else' completely interchangeably, often in the same function.

所以我的问题是:是否存在使用一个或另一个(单引号或双引号)的R行为不同的R代码?还是它们完全是同义词?

So my question is: Is there R code in which using one or other (single or double quotes) has different behaviour? Or are they totally synonymous?

推荐答案

> print(""hi"")
Error: unexpected symbol in "print(""hi"
> print("'hi'")
[1] "'hi'"
> print("hi")
[1] "hi"

这篇关于是双“"和单''引号(总是)在R中可以互换吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆