Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in R Programming by (50.2k points)

I have tried various functions like gsub, and str_replace, but I didn't get what I need.

gsub("\"", "\`", "map-09", fixed=TRUE) 

The above gives "map-09" and not map-09

str_replace("map-09","\"","\`")  

The above gives "map-09" and not map-09

1 Answer

0 votes
by (107k points)

Let me tell you one thing that the functions you're using in R programming don't actually add any quotes. But when the output is printed quotes are there to show you that it is a string being represented. For getting the desired output, use the function 'cat' to print the output you'll see it without the quotes.

See the difference between:

print("example")

cat("example")

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...