<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Another R-Script for a Zip File (NOAA)</title>
	<atom:link href="http://climateaudit.org/2007/04/26/another-r-script-for-a-zip-file-noaa/feed/" rel="self" type="application/rss+xml" />
	<link>http://climateaudit.org/2007/04/26/another-r-script-for-a-zip-file-noaa/</link>
	<description>by Steve McIntyre</description>
	<lastBuildDate>Sat, 18 May 2013 19:12:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Nicholas</title>
		<link>http://climateaudit.org/2007/04/26/another-r-script-for-a-zip-file-noaa/#comment-85767</link>
		<dc:creator><![CDATA[Nicholas]]></dc:creator>
		<pubDate>Fri, 27 Apr 2007 09:17:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=1486#comment-85767</guid>
		<description><![CDATA[MurrayK, it&#039;s tough to rely on anything which isn&#039;t a standard part of R, because as soon as you do, it makes it more difficult for people to download &amp; run Steve&#039;s scripts. I think it&#039;s OK if he requires some commonly used and widely available third party R packages, but would be extremely hesitant to require people to install znew on their system, especially for Windows users, where there may be no tidy GUI for installing that program.

That is why I wrote the R uncompress routine, because it was the only solution I could think of that wouldn&#039;t require users to jump through hoops to get the script to run. It works, but I don&#039;t think most people have the patience to wait for 2-4 minutes while the data decompresses. It&#039;d be even worse if the script had to deal with multiple .Z files. I&#039;d much rather just recompress those files myself and upload them to my web server, and point the scripts there. Less hassles for all of us.]]></description>
		<content:encoded><![CDATA[<p>MurrayK, it&#8217;s tough to rely on anything which isn&#8217;t a standard part of R, because as soon as you do, it makes it more difficult for people to download &amp; run Steve&#8217;s scripts. I think it&#8217;s OK if he requires some commonly used and widely available third party R packages, but would be extremely hesitant to require people to install znew on their system, especially for Windows users, where there may be no tidy GUI for installing that program.</p>
<p>That is why I wrote the R uncompress routine, because it was the only solution I could think of that wouldn&#8217;t require users to jump through hoops to get the script to run. It works, but I don&#8217;t think most people have the patience to wait for 2-4 minutes while the data decompresses. It&#8217;d be even worse if the script had to deal with multiple .Z files. I&#8217;d much rather just recompress those files myself and upload them to my web server, and point the scripts there. Less hassles for all of us.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MurrayK</title>
		<link>http://climateaudit.org/2007/04/26/another-r-script-for-a-zip-file-noaa/#comment-85766</link>
		<dc:creator><![CDATA[MurrayK]]></dc:creator>
		<pubDate>Fri, 27 Apr 2007 03:21:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=1486#comment-85766</guid>
		<description><![CDATA[znew recompresses files from .Z (compress) format to .gz (gzip) format. There&#039;s an example &lt;a href=&quot;http://prefetch.net/blog/index.php/2005/05/06/converting-compressed-z-files-to-compressed-gz-files/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. Perhaps the R &#039;system&#039; interface can call this utility first?]]></description>
		<content:encoded><![CDATA[<p>znew recompresses files from .Z (compress) format to .gz (gzip) format. There&#8217;s an example <a href="http://prefetch.net/blog/index.php/2005/05/06/converting-compressed-z-files-to-compressed-gz-files/" rel="nofollow">here</a>. Perhaps the R &#8216;system&#8217; interface can call this utility first?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicholas</title>
		<link>http://climateaudit.org/2007/04/26/another-r-script-for-a-zip-file-noaa/#comment-85765</link>
		<dc:creator><![CDATA[Nicholas]]></dc:creator>
		<pubDate>Fri, 27 Apr 2007 01:37:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=1486#comment-85765</guid>
		<description><![CDATA[mhcoffin, you&#039;re right, but the problem is while gzip may support uncompressing .Z files, the built-in R function gzfile does not work on .Z files. You can&#039;t rely on there being gzip installed on the system, since R is often run in Windows, where there is no gzip command-line program.

I wrote an R implementation of a Z decompressor (it&#039;s just dictionary-based so it wasn&#039;t too hard) but it takes several minutes to decompress a 1MB file. There&#039;s no way to I know avoid a for-loop since the compressed data is stored in variable length bit strings, and R is slow with for-loops.

The idea of renaming the file is interesting, but I don&#039;t think gzfile cares about the extension. It probably just calls the deflate algorithm, which returns an error because the data is not compressed with deflate. The gzip program is probably smart enough to detect the extension and call the modified-LZ78 routine instead, but R&#039;s built-in function doesn&#039;t seem to have that capability.]]></description>
		<content:encoded><![CDATA[<p>mhcoffin, you&#8217;re right, but the problem is while gzip may support uncompressing .Z files, the built-in R function gzfile does not work on .Z files. You can&#8217;t rely on there being gzip installed on the system, since R is often run in Windows, where there is no gzip command-line program.</p>
<p>I wrote an R implementation of a Z decompressor (it&#8217;s just dictionary-based so it wasn&#8217;t too hard) but it takes several minutes to decompress a 1MB file. There&#8217;s no way to I know avoid a for-loop since the compressed data is stored in variable length bit strings, and R is slow with for-loops.</p>
<p>The idea of renaming the file is interesting, but I don&#8217;t think gzfile cares about the extension. It probably just calls the deflate algorithm, which returns an error because the data is not compressed with deflate. The gzip program is probably smart enough to detect the extension and call the modified-LZ78 routine instead, but R&#8217;s built-in function doesn&#8217;t seem to have that capability.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mhcoffin</title>
		<link>http://climateaudit.org/2007/04/26/another-r-script-for-a-zip-file-noaa/#comment-85764</link>
		<dc:creator><![CDATA[mhcoffin]]></dc:creator>
		<pubDate>Thu, 26 Apr 2007 16:50:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=1486#comment-85764</guid>
		<description><![CDATA[Files with a .Z suffix are probably generated by &quot;compress&quot;.  Compress was the standard Unix compression utility until Unisys, which owned a patent on Lempel-Ziv compression, began trying to enforce their patent. (That patent expired a few years ago, but by then gzip had become standard.)

The good news is the patent didn&#039;t cover decompression, so gunzip will happily uncompress .Z files. If R supports gzip, it can probably be tricked into decompressing .Z files pretty easily. Maybe by merely renaming the file to .gz and pretending it&#039;s gzipped.]]></description>
		<content:encoded><![CDATA[<p>Files with a .Z suffix are probably generated by &#8220;compress&#8221;.  Compress was the standard Unix compression utility until Unisys, which owned a patent on Lempel-Ziv compression, began trying to enforce their patent. (That patent expired a few years ago, but by then gzip had become standard.)</p>
<p>The good news is the patent didn&#8217;t cover decompression, so gunzip will happily uncompress .Z files. If R supports gzip, it can probably be tricked into decompressing .Z files pretty easily. Maybe by merely renaming the file to .gz and pretending it&#8217;s gzipped.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Skip</title>
		<link>http://climateaudit.org/2007/04/26/another-r-script-for-a-zip-file-noaa/#comment-85763</link>
		<dc:creator><![CDATA[Skip]]></dc:creator>
		<pubDate>Thu, 26 Apr 2007 15:57:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=1486#comment-85763</guid>
		<description><![CDATA[The &quot;wb&quot; is likely just passed through to the c runtime library fopen() function.   Likely values are:

&quot;wb&quot; - open for writing as a binary file
&quot;w&quot; - open for writing as a text file.  This will change end of line characters to be appropriate for the system that it&#039;s downloaded to.
&quot;ab&quot; - same as &quot;wb&quot; but appending instead of creating the file new
&quot;a&quot; - same as &quot;w&quot; but appending.

You need the &quot;wb&quot; if it&#039;s a zip file because otherwise it will likely corrupt the file.]]></description>
		<content:encoded><![CDATA[<p>The &#8220;wb&#8221; is likely just passed through to the c runtime library fopen() function.   Likely values are:</p>
<p>&#8220;wb&#8221; &#8211; open for writing as a binary file<br />
&#8220;w&#8221; &#8211; open for writing as a text file.  This will change end of line characters to be appropriate for the system that it&#8217;s downloaded to.<br />
&#8220;ab&#8221; &#8211; same as &#8220;wb&#8221; but appending instead of creating the file new<br />
&#8220;a&#8221; &#8211; same as &#8220;w&#8221; but appending.</p>
<p>You need the &#8220;wb&#8221; if it&#8217;s a zip file because otherwise it will likely corrupt the file.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
