当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


R语言 noquote()用法及代码示例


R 语言中的 noquote() 函数用于打印不带引号的字符串。

用法: noquote(x)

参数:
x:字符向量

范例1:


# R program to illustrate
# noquote function
  
# Getting letters without the help
# of noquote() function
letters
  
# Getting letters with the help
# of noquote() function
noquote(letters)

输出:

[1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s"
[20] "t" "u" "v" "w" "x" "y" "z"
[1] a b c d e f g h i j k l m n o p q r s t u v w x y z

范例2:


# R program to illustrate
# noquote function
  
# Initializing a string
x <- "GFG"
  
# Getting the string without the help
# of noquote() function
x
  
# Getting the string with the help
# of noquote() function
noquote(x)

输出:

[1] "GFG"
[1] GFG

相关用法


注:本文由纯净天空筛选整理自Kanchan_Ray大神的英文原创作品 Print Strings without Quotes in R Programming – noquote() Function。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。