<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://www.smithnet.org.uk/wiki/index.php?action=history&amp;feed=atom&amp;title=R</id>
	<title>R - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.smithnet.org.uk/wiki/index.php?action=history&amp;feed=atom&amp;title=R"/>
	<link rel="alternate" type="text/html" href="https://www.smithnet.org.uk/wiki/index.php?title=R&amp;action=history"/>
	<updated>2026-04-10T20:35:47Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://www.smithnet.org.uk/wiki/index.php?title=R&amp;diff=519&amp;oldid=prev</id>
		<title>NickPGSmith: 2 revisions imported</title>
		<link rel="alternate" type="text/html" href="https://www.smithnet.org.uk/wiki/index.php?title=R&amp;diff=519&amp;oldid=prev"/>
		<updated>2024-05-08T04:53:41Z</updated>

		<summary type="html">&lt;p&gt;2 revisions imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 04:53, 8 May 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>NickPGSmith</name></author>
	</entry>
	<entry>
		<id>https://www.smithnet.org.uk/wiki/index.php?title=R&amp;diff=518&amp;oldid=prev</id>
		<title>NickPGSmith: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://www.smithnet.org.uk/wiki/index.php?title=R&amp;diff=518&amp;oldid=prev"/>
		<updated>2023-02-17T21:02:13Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:02, 17 February 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wiki-wiki-:diff:1.41:old-517:rev-518 --&gt;
&lt;/table&gt;</summary>
		<author><name>NickPGSmith</name></author>
	</entry>
	<entry>
		<id>https://www.smithnet.org.uk/wiki/index.php?title=R&amp;diff=517&amp;oldid=prev</id>
		<title>NickPGSmith: Created page with &quot;== Notes ==  Guides: * [http://www.statmethods.net/index.html Quick-R]   source(&#039;somefile.R&#039;)  sink(&#039;somrfile.txt&#039;, append=TRUE); # Write (append) to file  sink() # Return to...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.smithnet.org.uk/wiki/index.php?title=R&amp;diff=517&amp;oldid=prev"/>
		<updated>2021-05-23T14:57:02Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Notes ==  Guides: * [http://www.statmethods.net/index.html Quick-R]   source(&amp;#039;somefile.R&amp;#039;)  sink(&amp;#039;somrfile.txt&amp;#039;, append=TRUE); # Write (append) to file  sink() # Return to...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Notes ==&lt;br /&gt;
&lt;br /&gt;
Guides:&lt;br /&gt;
* [http://www.statmethods.net/index.html Quick-R]&lt;br /&gt;
&lt;br /&gt;
 source(&amp;#039;somefile.R&amp;#039;)&lt;br /&gt;
 sink(&amp;#039;somrfile.txt&amp;#039;, append=TRUE); # Write (append) to file&lt;br /&gt;
 sink() # Return to terminal&lt;br /&gt;
 png(&amp;#039;somefile.png&amp;#039;) # Redirect to image&lt;br /&gt;
 plot(x)&lt;br /&gt;
 dev.off() # Stop writing to image&lt;br /&gt;
 q() # Quit&lt;br /&gt;
&lt;br /&gt;
Running R from an external script&lt;br /&gt;
* -f something.R&lt;br /&gt;
&lt;br /&gt;
== RPostgreSQL ==&lt;br /&gt;
&lt;br /&gt;
Include lib:&lt;br /&gt;
&lt;br /&gt;
 library(RPostgreSQL)&lt;br /&gt;
&lt;br /&gt;
Example of connecting to postgres:&lt;br /&gt;
&lt;br /&gt;
 drv &amp;lt;- dbDriver(&amp;#039;PostgreSQL&amp;#039;)&lt;br /&gt;
 con &amp;lt;- dbConnect(drv, dbname=&amp;#039;somedatabase&amp;#039;, user=&amp;#039;someuser&amp;#039;, pass=&amp;#039;somepass&amp;#039;)&lt;br /&gt;
 data &amp;lt;- dbReadTable(con, &amp;#039;sometable&amp;#039;)&lt;br /&gt;
 head(data, 100)&lt;br /&gt;
 dbDisconnect(con)&lt;br /&gt;
 dbUnloadDriver(drv)&lt;br /&gt;
&lt;br /&gt;
Or like this with SQL/fetch (large tables can be streamed):&lt;br /&gt;
&lt;br /&gt;
 drv &amp;lt;- dbDriver(&amp;#039;PostgreSQL&amp;#039;)&lt;br /&gt;
 con &amp;lt;- dbConnect(drv)&lt;br /&gt;
 res &amp;lt;- dbSendQuery(con, &amp;#039;SELECT * from sometable&amp;#039;)&lt;br /&gt;
 data &amp;lt;- fetch(res, n = -1)&lt;br /&gt;
&lt;br /&gt;
See also [https://code.google.com/p/rpostgresql/ here]&lt;/div&gt;</summary>
		<author><name>NickPGSmith</name></author>
	</entry>
</feed>