-1

I would like to be able to copy and paste the output in R console without always having to remove these tags and quotes

print('love')
[1] "love"

What I require

print('love')
love

Note: I also want to remove the [1] not only the double quotes.

TSR
  • 17,242
  • 27
  • 93
  • 197

1 Answers1

1

You could use the cat function, it will indeed print your string without parenthesis:

cat('love')
#### love

See the help page ?cat

Outputs the objects, concatenating the representations. cat performs much less conversion than print.

You might also use print with the quote argument:

print("love", quote=FALSE)
#### [1] love

That way, you still get the [1] See also this thread: https://stackoverflow.com/a/5218361/3871924

Community
  • 1
  • 1
agenis
  • 8,069
  • 5
  • 53
  • 102