Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
substrを使用すると、円記号は印刷の成果物のように見えることがわかります。
substr(my.string,2,2)
与える
[1] "\""
また、文字列の長さは希望どおりです。
> nchar(my.string) [1] 3
バックスラッシュなしで文字列を印刷する場合は、noquoteを使用します。
> noquote(my.string) [1] a""
バックスラッシュは print メソッドのアーティファクトです。実際、デフォルトprintでは文字列が引用符で囲まれています。これを無効にするには、引数quoteを FALSE に設定します。
print
quote
たとえば、次を使用できます。
print(my.string,quote=FALSE) [1] a""
しかし、私はこれを使用するcatか、write好きです:
cat
write
cat(my.string) a"" write(my.string,"") a""