<?xml version="1.0" encoding="UTF-8" ?>
<!-- RSS generated by PHPBoost on Sun, 17 May 2026 15:58:31 +0200 -->

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Last articles - STHDA : Importing & Exporting Data]]></title>
		<atom:link href="https://www.sthda.com/english/syndication/rss/articles/6" rel="self" type="application/rss+xml"/>
		<link>https://www.sthda.com</link>
		<description><![CDATA[Last articles - STHDA : Importing & Exporting Data]]></description>
		<copyright>(C) 2005-2026 PHPBoost</copyright>
		<language>en</language>
		<generator>PHPBoost</generator>
		
		
		<item>
			<title><![CDATA[Importing Data Sets Into R by Copying and Pasting]]></title>
			<link>https://www.sthda.com/english/articles/6-importing-exporting-data/56-importing-data-sets-into-r-by-copying-and-pasting/</link>
			<guid>https://www.sthda.com/english/articles/6-importing-exporting-data/56-importing-data-sets-into-r-by-copying-and-pasting/</guid>
			<description><![CDATA[To <strong>import</strong> small data sets into <strong>R</strong> by copying and pasting, you can use the combination of the functions <strong>read.table</strong>() and <strong>textConnection</strong>().<br />
<br />
For example:<br />
<br />
<div class="formatter-container formatter-code code-R"><span class="formatter-title">Code R :</span><div class="formatter-content"><pre style="display:inline;"><pre class="r" style="font-family:monospace;">&amp;nbsp;
<span style="color: #228B22;"># Copy and paste small data set into an R object</span>
small_dataset <span style="color: #080;"><-</span> <span style="color: #ff0000;">"cl   scl len ylabel_pos
1  0 chr13  56         56
2  0 chr17  96        152
3  1 chr13  34         34
4  1 chr17 166        200"</span>
&amp;nbsp;
<span style="color: #228B22;"># Import the small data set into R data frame</span>
<span style="color: #0000FF; font-weight: bold;">df</span> <span style="color: #080;"><-</span> <span style="color: #0000FF; font-weight: bold;">read.<span style="">table</span></span><span style="color: #080;">&amp;#40;</span><span style="color: #0000FF; font-weight: bold;">textConnection</span><span style="color: #080;">&amp;#40;</span>small_dataset<span style="color: #080;">&amp;#41;</span>, header<span style="color: #080;">=</span>TRUE<span style="color: #080;">&amp;#41;</span>
<span style="color: #0000FF; font-weight: bold;">print</span><span style="color: #080;">&amp;#40;</span><span style="color: #0000FF; font-weight: bold;">df</span><span style="color: #080;">&amp;#41;</span>
&amp;nbsp;</pre></pre></div></div><br />
<br />
The imported data looks like this:<br />
<br />
<!-- START HTML -->

<pre>
  cl   scl len ylabel_pos
1  0 chr13  56         56
2  0 chr17  96        152
3  1 chr13  34         34
4  1 chr17 166        200
</pre>

<!-- END HTML -->]]></description>
			<pubDate>Tue, 08 Aug 2017 11:06:00 +0200</pubDate>
			
		</item>
		
	</channel>
</rss>
