Martin Elff | 1 Nov 2008 12:09
Picon

Re: [Rd] Small modification of zip.file.extract in utils?

On Thursday 30 October 2008 (20:08:27), Jon Olav Skoien wrote:
> Dear list,
>
> I needed to extract a zip-archive, and found zip.file.extract in utils.
> My only problem was the use of tempdir(), since I wanted to permanently
> extract the archive at a fixed location for later use. My own fix was
> simple, adding an extra parameter zipdir (without default), and within
> the function change
> tmpd <- tempdir()
> to
> tmpd = ifelse(missing(zipdir),tempdir(),zipdir)
>
> This modification could maybe be useful also for other users, unless
> there are some problems I am not aware of?

I had similar problems with 'zip.file.extract' and implemented
a function 'unzip' in my package 'memisc', which also works in a way that is 
probably more comprehensible for end-users like me:

unzip                 package:memisc                 R Documentation

Extract Files from Zip Files

Description:

     'unzip' extracts a file from a zip archive and puts them into a
     directory specified by the user or into the temporary directory of
     the current session.

Usage:
(Continue reading)

Spencer Graves | 1 Nov 2008 16:40

[Rd] cat: ./R/Copy: No such file or directory

Hello: 

      What do you recommend I do to get past cryptic error messages from 
"R CMD check", complaining "No such file or directory"?  The package is 
under SVN control, and I reverted to a version that passed "R CMD 
check", without eliminating the error.  The "00install.out" file is 
short and bitter: 

cat: ./R/Copy: No such file or directory
cat: of: No such file or directory
cat: create.fourier.basis.R: No such file or directory
make: *** [Rcode0] Error 1

---------- Making package fda ------------
  adding build stamp to DESCRIPTION
  installing NAMESPACE file and metadata
make[2]: *** No rule to make target `R/Copy', needed by 
`D:/spencerg/statmtds/splines/fda/RForge/fda/fda.Rcheck/fda/R/fda'.  Stop.
make[1]: *** [all] Error 2
make: *** [pkg-fda] Error 2
*** Installation of fda failed ***

Removing 'D:/spencerg/statmtds/splines/fda/RForge/fda/fda.Rcheck/fda'

     
      Thanks for any suggestions.  I have a "*.tar.gz" file that I hope 
may not have this problem, but I'm not sure. 

      Thanks,
      Spencer
(Continue reading)

Ted.Harding | 1 Nov 2008 17:19
Picon
Favicon

Re: [Rd] cat: ./R/Copy: No such file or directory

Just guessing here, but it looks as though an attempt has been made
to execute the following command:

  cat ./R/Copy of create.fourier.basis.R

This may have arisen because there is indeed a file named

  "Copy of create.fourier.basis.R"

but the command was issued to the OS without quotes; or (perhaps
less likely, because of the presence of the "./R/") the line

  "Copy of create.fourier.basis.R"

was intended as a comment in the file, but somehow got read as
a substantive part of the code.

Good luck!
Ted.

On 01-Nov-08 15:40:33, Spencer Graves wrote:
> Hello: 
> 
>       What do you recommend I do to get past cryptic error messages
> from 
> "R CMD check", complaining "No such file or directory"?  The package is
> under SVN control, and I reverted to a version that passed "R CMD 
> check", without eliminating the error.  The "00install.out" file is 
> short and bitter: 
> 
(Continue reading)

Spencer Graves | 2 Nov 2008 01:53

Re: [Rd] cat: ./R/Copy: No such file or directory

Dear Ted: 

      Thanks very much.  In fact, I did have a file named "Copy of 
create.fourier.basis.R".  I deleted it and got an even more cryptic 
version of the same error message.  I ultimately traced this to lines 
like "<<<<<<< .working" inserted by subversion into a *.R or *.Rd file I 
was using.  I found this by finding a previous "*.tar.gz" file that 
passed "R CMD check", studying the subversion log of 7 different changes 
made by 3 people since that one that worked, and reviewing changes made 
to at least 13 different files in that period until I found the problem. 

      Best Wishes,
      Spencer

(Ted Harding) wrote:
> Just guessing here, but it looks as though an attempt has been made
> to execute the following command:
>
>   cat ./R/Copy of create.fourier.basis.R
>
> This may have arisen because there is indeed a file named
>
>   "Copy of create.fourier.basis.R"
>
> but the command was issued to the OS without quotes; or (perhaps
> less likely, because of the presence of the "./R/") the line
>
>   "Copy of create.fourier.basis.R"
>
> was intended as a comment in the file, but somehow got read as
(Continue reading)

Duncan Murdoch | 2 Nov 2008 02:35
Picon
Favicon

Re: [Rd] cat: ./R/Copy: No such file or directory

On 01/11/2008 8:53 PM, Spencer Graves wrote:
> Dear Ted: 
> 
>       Thanks very much.  In fact, I did have a file named "Copy of 
> create.fourier.basis.R".  I deleted it and got an even more cryptic 
> version of the same error message.  I ultimately traced this to lines 
> like "<<<<<<< .working" inserted by subversion into a *.R or *.Rd file I 
> was using.  I found this by finding a previous "*.tar.gz" file that 
> passed "R CMD check", studying the subversion log of 7 different changes 
> made by 3 people since that one that worked, and reviewing changes made 
> to at least 13 different files in that period until I found the problem. 

Hi Spencer.

If you're using Windows, I really recommend using TortoiseSVN.  It'll 
make it very easy to see conflict markers like the one that caused your 
trouble.  (I don't like their compare utility, but it's easy to plug in 
a different one. I use Beyond Compare.)

If you're not on Windows, there are probably similar things available, 
but I don't know what they are.

Duncan Murdoch

> 
>       Best Wishes,
>       Spencer
> 
> (Ted Harding) wrote:
>> Just guessing here, but it looks as though an attempt has been made
(Continue reading)

Spencer Graves | 2 Nov 2008 03:19

Re: [Rd] cat: ./R/Copy: No such file or directory

Dear Duncan: 

<in line>

Duncan Murdoch wrote:
> On 01/11/2008 8:53 PM, Spencer Graves wrote:
>> Dear Ted:
>>       Thanks very much.  In fact, I did have a file named "Copy of 
>> create.fourier.basis.R".  I deleted it and got an even more cryptic 
>> version of the same error message.  I ultimately traced this to lines 
>> like "<<<<<<< .working" inserted by subversion into a *.R or *.Rd 
>> file I was using.  I found this by finding a previous "*.tar.gz" file 
>> that passed "R CMD check", studying the subversion log of 7 different 
>> changes made by 3 people since that one that worked, and reviewing 
>> changes made to at least 13 different files in that period until I 
>> found the problem. 
>
> Hi Spencer.
>
> If you're using Windows, I really recommend using TortoiseSVN.  It'll 
> make it very easy to see conflict markers like the one that caused 
> your trouble.  (I don't like their compare utility, but it's easy to 
> plug in a different one. I use Beyond Compare.)
      I've been using TortoiseSVN for roughly 18 months now, but I had 
previously not used much of its capabilities.  The log and diff files 
helped narrow the problem from someplace in 400 files to someplace in 13. 

      It would be nice if the "R CMD check" diagnostics were more clear 
about things like this.  However, even with these problems, it is vastly 
superior to the anarchy that organizes the software development efforts 
(Continue reading)

Prof Brian Ripley | 2 Nov 2008 08:08
Picon
Picon
Favicon

Re: [Rd] cat: ./R/Copy: No such file or directory

Please note that the assmuption is that you can install a pacakge before 
you check it.

R CMD INSTALL often gives fuller diagnostics: I am not sure these would 
have helped you here, but I would have expected you to have got a 'syntax 
error' message (which is not 'cryptic': you did have syntax errors in your 
files).

On Sat, 1 Nov 2008, Spencer Graves wrote:

> Dear Duncan: 
> <in line>
>
> Duncan Murdoch wrote:
>> On 01/11/2008 8:53 PM, Spencer Graves wrote:
>>> Dear Ted:
>>>       Thanks very much.  In fact, I did have a file named "Copy of 
>>> create.fourier.basis.R".  I deleted it and got an even more cryptic 
>>> version of the same error message.  I ultimately traced this to lines like 
>>> "<<<<<<< .working" inserted by subversion into a *.R or *.Rd file I was 
>>> using.  I found this by finding a previous "*.tar.gz" file that passed "R 
>>> CMD check", studying the subversion log of 7 different changes made by 3 
>>> people since that one that worked, and reviewing changes made to at least 
>>> 13 different files in that period until I found the problem. 
>> 
>> Hi Spencer.
>> 
>> If you're using Windows, I really recommend using TortoiseSVN.  It'll make 
>> it very easy to see conflict markers like the one that caused your trouble. 
>> (I don't like their compare utility, but it's easy to plug in a different 
(Continue reading)

Deepayan Sarkar | 2 Nov 2008 09:04
Picon

[Rd] Emacs tags for R code

Hi,

I have put up details of a new tool for tagging R code at

http://dsarkar.fhcrc.org/rtags/rtags.html

that Emacs/ESS users may be interested in. It should be possible to
extend this for other editors as well.

Comments and feedback welcome.

-Deepayan

______________________________________________
R-devel <at> r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Gabor Grothendieck | 2 Nov 2008 15:33
Picon

[Rd] Wishlist: pass args from demo() to source()

Currently demo calls source with a hard coded max.deparse.length = 250
so you can't really see the demo properly in some cases.  Note the
[TRUNCATED] below.  (1) It would be nice if demo passed max.deparse.length
(and other args to source).  (2) Also a larger max.deparse.length default would
be nice to make it less likely one would have to set it in the first place.

> R.version.string # Vista
[1] "R version 2.8.0 Patched (2008-10-21 r46766)"
> demo("gsubfn-si")

        demo(gsubfn-si)
        ---- ~~~~~~~~~

Type  <Return>   to start :

> # given number possibly followed by SI letter (e.g. 32.5k where k means 1000)
> # replace letter with e followed by appropriate digits.
> # (see formatEng2R by Hans-Joerg Bibiko in the R Wiki)
>
> conv <- list(y = "e-24", z = "e-21", a = "e-18", f .... [TRUNCATED]

> gsubfn(".$", conv, c("19", "32.5M"))
[1] "19"     "32.5e6"

______________________________________________
R-devel <at> r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Duncan Murdoch | 2 Nov 2008 16:19
Picon
Favicon

Re: [Rd] Wishlist: pass args from demo() to source()

On 02/11/2008 9:33 AM, Gabor Grothendieck wrote:
> Currently demo calls source with a hard coded max.deparse.length = 250
> so you can't really see the demo properly in some cases.  Note the
> [TRUNCATED] below.  (1) It would be nice if demo passed max.deparse.length
> (and other args to source).  (2) Also a larger max.deparse.length default would
> be nice to make it less likely one would have to set it in the first place.

I can see increasing the default, but it doesn't really seem like a good 
design to give extra args to demo().  Would users ever know about them?

So to me the choice would be to set a large max.deparse.length in the 
call to source() from demo().

Just for fun, I tracked down the revision where the 250 value was 
introduced:  it was in r3045 in December 1998 on 
https://svn.r-project.org/R/branches/R-0-63-patches/src/library/base/R/source.R, 
where the max was decreased from 10000 to 250.  (The demo() function was 
in source.R in those days.)  And the 10000 was added in r354 in December 
1997 to https://svn.r-project.org/R/trunk/src/library/base/R/source, to 
remove the TRUNCATED message.

Martin, is there any chance you remember what problem the 10000 caused? 
  If those problems still exist, I'd add an arg to demo with 250 as the 
default, but if not, I'd say putting it back as 10000 would be reasonable.

Duncan Murdoch

> 
>> R.version.string # Vista
> [1] "R version 2.8.0 Patched (2008-10-21 r46766)"
(Continue reading)


Gmane