Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to put quotes around several words quickly in Rstudio?

Tags:

r

rstudio

How to I make MI, ID, FL, into "MI", "ID", "FL" without having to type every single double quote?

like image 955
tnabdb Avatar asked Jun 27 '16 06:06

tnabdb


2 Answers

You may want to check out the datapasta package!

If you follow directions under "Pasting a list as a horizontal vector with vector_paste()" of the linked vignette, you'll be able to type something like MI, ID, FL cut it and then use an assigned keyboard shortcut, say shift + cmd + v, to paste it into c("MI", "ID", "FL").

like image 189
Stelios Serghiou Avatar answered Nov 13 '22 13:11

Stelios Serghiou


The Hmisc package has a function Cs(), it will evaluate comma separated text as having quotes.

Cs(MI, ID, FL)
#becomes:
"MI", "ID", "FL"
like image 41
Dick McManus Avatar answered Nov 13 '22 13:11

Dick McManus