One of the features I feel that I don’t leverage enough, particularly for ad-hoc questions, is the clipboard feature in R. I know there are many ways to use it – as I have been exposed to a few – but the example below, even without context, should get you thinking about how awesome R really is. Essentially, think of a vector in R as equivalent to a column of data in Excel or SPSS and you are good to go.

your.vector <- readClipboard()

I found the code snippet here and started running. If you select a column of your data, you can piece together a dataset from the Internet VERY QUICKLY simply by creating new objects (e.g. your.vector2).

Routinely, I find the need to grab data quickly from the world wide interwebs, but don’t have the ability to write a script to parse it quickly . Lately, I simply copy the data I need into Excel, clean it quickly, select my columns one by one and to piece the data back together inside R.

If you feel that you will need this hacked together dataframe later, simply save it as an *.Rdata file and call it a night.

Filed under: How-to, R, Uncategorized Tagged: Copy Clipboard in R, Data management, R, SPSS

*Related*

R-bloggers.com offers

**daily e-mail updates** about

R news and

tutorials on topics such as:

Data science,

Big Data, R jobs, visualization (

ggplot2,

Boxplots,

maps,

animation), programming (

RStudio,

Sweave,

LaTeX,

SQL,

Eclipse,

git,

hadoop,

Web Scraping) statistics (

regression,

PCA,

time series,

trading) and more...

If you got this far, why not

__subscribe for updates__ from the site? Choose your flavor:

e-mail,

twitter,

RSS, or

facebook...

**Tags:** Copy Clipboard in R, Data management, how to, R, SPSS, Uncategorized