當前位置: 首頁>>代碼示例 >>用法及示例精選 >>正文


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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。