[Rd] R v2.11.0: HTML package index broken(?)

2009-10-17 Thread Henrik Bengtsson
Hi,

in R v2.11.0 (2009-10-15 r50085) on Windows Vista the package index
and its links for the package installed in the user-specific library
path are all broken, e.g.

In http://127.0.0.1:28251/doc/html/packages.html I get:

Packages in C:\Users\hb\R\win-library\2.11
C:\Users\hb/R/win-library/2.11/abind/DESCRIPTION-- Title is missing --
[...]
Packages in the standard library
baseThe R Base Package
[...]

and the links are of format:

http://127.0.0.1:28251/library/C:%5CUsers%5Chb/R/win-library/2.11/abind/DESCRIPTION/html/00Index.html

It seems like they should be of format:

http://127.0.0.1:28251/library/abind/html/00Index.html

/Henrik

The above and below is when using Rterm --vanilla.

 .libPaths()
[1] C:\\Users\\hb/R/win-library/2.11  C:/PROGRA~1/R/R-2.11.0dev/library

 sessionInfo()
R version 2.11.0 Under development (unstable) (2009-10-15 r50085)
i386-pc-mingw32

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

loaded via a namespace (and not attached):
[1] tools_2.11.0

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] forwarded: bug (?) in cut.POSIXt with breaks=integer

2009-10-17 Thread Vitalie S.

On Fri, 16 Oct 2009 16:12:40 +0200, Ben Bolker bol...@ufl.edu wrote:



PS a parallel problem seems to occur in cut.Date  ... cut.POSIXt and  
cut.Date

both allow
breaks to be a single integer specifying the number of breaks, and both  
call


 if(is.null(labels)) levels(res) - as.character(breaks[-length(breaks)])
near the end of the function, which breaks (so to speak) if
length(breaks)!=length(levels(res))-1

I could keep working on a patch if requested, but probably won't  
otherwise.


I believe it's an important issue. In plotting long time series grouping  
is indispensable.

Thank you, Ben, for working on that.

May I take this opportunity and propose an additional argument by to  
cut function. This would make cut similar to seq and cut.POSIXt (in the  
latter, intervals as 30 s are allowed in breaks specification).  
Conceptually it's often simpler to think in terms of the length of  
interval than the number of intervals in breaks.


Thanks,
Vitalie.


  Ben Bolker








__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Goto BLAS

2009-10-17 Thread Evan Cooch
I was on the Goto BLAS maillist yesterday, asking some question about 
relative speed/performance/tuning of Goto BLAS and (specifically) R.


I received a reply from Kazushige Goto (the developer and maintainer of 
Goto BLAS), who as part of his answer to some of my queries made the 
following comment concerning R, which I pass along to the R development 
team:


By the way, please ask your R developer to rewrite memory allocation 
function including garbage collection. They give 4 byte offset memory 
region and never perform well (or it will cause segmentation fault. 4 
byte offset is fatal). Since R use complex double precision, memory 
alignment should be at least 16 bytes...




Apparently, Goto has run into some issues with R before.  I'll assume 
that some out there will be able to interpret Goto's comment/suggestion.


__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] linking to package directories broken in R = 2.10 beta

2009-10-17 Thread Thomas Petzoldt

Dear R developers,

some of our packages come with additional programming examples in a 
directory called /examples which is created from /inst/examples.


This directory is linked from the docs (e.g. in inst/doc/index.html):

dl
dta href=../examples/examples/a:
ddSource code of examples
/dl

Given, that we have a package foo this is resolved to:

file:///C:/Programme/R/R-2.9.2/library/foo/examples/

with R = 2.9.2. With R 2.10 beta (R-beta_2009-10-16_r50118.tar.gz) and 
R-devel (svn rev. 50118) we get:


http://127.0.0.1:26383/library/foo/examples/

This is fine, but in contrast to older versions (= 2.9.2) no automatic 
index is created for the linked directory, so we now get:


URL /library/foo/examples/ was not found

bu linking to *individual files* (e.g. examples/example.R) works as 
expected. We can, of course, add manually maintained index files but I 
would much prefer if a default index would be created for the directory 
if no index.html is found.


I very much enjoy the new help system and would be even more happy if 
that issue could be fixed.


Thomas Petzoldt


PS: A minimal reproducible example (foo_1.0.tar.gz) can be provided by 
mail if required.


--
Thomas Petzoldt
Technische Universitaet Dresden
Institut fuer Hydrobiologiethomas.petzo...@tu-dresden.de
01062 Dresden  http://tu-dresden.de/hydrobiologie/
GERMANY

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] (PR#14012)

2009-10-17 Thread sje30
I think Rscript has a problem running files that have mac encodings
for newline (^M rather than ^J on linux).  If I source the file within
R, it works okay:

 source('j.R')
[1] MEA_data/sernagor_new/CRX_P7_1.txt

But if I run the file using Rscript on a linux box I get a strange
error message: 

$ Rscript --vanilla j.R

Execution halted

The example script j.R is at http://www.damtp.cam.ac.uk/user/sje30/j.R
rather than attaching it here.  I don't think there is anything
specific about the script though apart from the line endings.

Stephen

--please do not edit the information below--

Version:
 platform = x86_64-pc-linux-gnu
 arch = x86_64
 os = linux-gnu
 system = x86_64, linux-gnu
 status = 
 major = 2
 minor = 9.2
 year = 2009
 month = 08
 day = 24
 svn rev = 49384
 language = R
 version.string = R version 2.9.2 (2009-08-24)

Locale:
LC_CTYPE=en_GB.UTF-8;LC_NUMERIC=C;LC_TIME=en_GB.UTF-8;LC_COLLATE=en_GB.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=en_GB.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTIFICATION=C

Search Path:
 .GlobalEnv, package:stats, package:graphics, package:grDevices, package:utils, 
package:datasets, package:methods, Autoloads, package:base

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] forwarded: bug (?) in cut.POSIXt with breaks=integer

2009-10-17 Thread Gabor Grothendieck
That is usually done with trunc rather than cut since in the case of a
time series we normally don't want a factor result (which is what cut
would give):

trunc(tt, secs)
trunc(tt, mins)
# etc

trunc.POSIXt does not support the 30 secs syntax but trunc.times in
the chron package supports similar functionality:

library(chron)
trunc(as.chron(format(tt)), 00:00:30)

# or relative to GMT
trunc(as.chron(tt)), 00:00:30)

On Thu, Oct 15, 2009 at 1:10 PM, Ben Bolker bol...@ufl.edu wrote:

 From: Vitalie S. vitosmail at rambler.ru
 Subject: Bug in cut.POSIXt
 Newsgroups: gmane.comp.lang.r.general
 Date: 2009-10-15 15:47:48 GMT (1 hour and 29 minutes ago)

 Hello Everyone,

 Before reporting decided to post here first:

 tt - structure(c(1254238817, 1254238859, 1254238969, 1254239080), class =
 c(POSIXt,
                                                              POSIXct),
 tzone = )

 cut.POSIXt(tt, 2)
 #Error in `levels-.factor`(`*tmp*`, value = character(0)) :
 #  number of levels differs

 cut.POSIXt(tt, 2, labels=c(a1, a2))
 #[1] a1 a1 a2 a2
 #Levels: a1 a2

 cut(tt, 2 mins)
 #[1] 2009-09-29 17:40:00 2009-09-29 17:40:00 2009-09-29 17:42:00
 2009-09-29 17:44:00
 #Levels: 2009-09-29 17:40:00 2009-09-29 17:42:00 2009-09-29 17:44:00

 sessionInfo()
 R version 2.9.2 Patched (2009-09-24 r50069)
 i386-pc-mingw32

 locale:
 LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
 States.1252;LC_MONETARY=English_United
 States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

 attached base packages:
 [1] stats     graphics  utils     datasets  grDevices methods   base


 Vitalie.


 ==

  I would agree that this is a bug ... this patch gets rid of the error,
 but leaves the labels very ugly -- given enough hours I might be able to
 figure out how to make the labels nice, but someone else can probably do
 it quicker (see comments in code below)


  It would probably also be worth adding something like

 cut(Dates,2)

  around line 5067 of reg-tests-1.R


 --- datetime.R  2009-10-15 13:01:15.0 -0400
 ***
 *** 764,770 
        }
      } else stop(invalid specification of 'breaks')
      res - cut(unclass(x), unclass(breaks), labels = labels, right =
 right, ...)
 !     if(is.null(labels)) levels(res) -
 as.character(breaks[-length(breaks)])
      res
  }

 --- 764,782 
        }
      } else stop(invalid specification of 'breaks')
      res - cut(unclass(x), unclass(breaks), labels = labels, right =
 right, ...)
 !     if(is.null(labels)) {
 !       if (is.numeric(breaks)  length(breaks) == 1L)
 !         levels(res) - as.character(breaks[-length(breaks)])
 !       } else {
 !         ## ?? what should happen here?
 !         ## this version simply leaves the break values
 !         ## as numeric (and very ugly)
 !         ## I don't know how to safely convert the breakpoints
 !         ## back to a character format (e.g.
 !         ## levels(res) = [1970-01-01 00:00:00,1970-01-01 12:00:00)
 !         ## instead of [18000,61200)
 !       }
 !     }
      res
  }


 --
 Ben Bolker
 Associate professor, Biology Dep't, Univ. of Florida
 bol...@ufl.edu / www.zoology.ufl.edu/bolker
 GPG key: www.zoology.ufl.edu/bolker/benbolker-publickey.asc


 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel



__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] linking to package directories broken in R = 2.10 beta

2009-10-17 Thread Duncan Murdoch

Thomas Petzoldt wrote:

Dear R developers,

some of our packages come with additional programming examples in a 
directory called /examples which is created from /inst/examples.


This directory is linked from the docs (e.g. in inst/doc/index.html):

dl
dta href=../examples/examples/a:
ddSource code of examples
/dl

Given, that we have a package foo this is resolved to:

file:///C:/Programme/R/R-2.9.2/library/foo/examples/

with R = 2.9.2. With R 2.10 beta (R-beta_2009-10-16_r50118.tar.gz) and 
R-devel (svn rev. 50118) we get:


http://127.0.0.1:26383/library/foo/examples/

This is fine, but in contrast to older versions (= 2.9.2) no automatic 
index is created for the linked directory, so we now get:


URL /library/foo/examples/ was not found

bu linking to *individual files* (e.g. examples/example.R) works as 
expected. We can, of course, add manually maintained index files but I 
would much prefer if a default index would be created for the directory 
if no index.html is found.
  


By index in R = 2.9.2, you mean the default directory listing 
produced by the web server, rather than something produced by R, right?  
The R server does that now if the directory is named doc, but not for 
an arbitrary path.  We are concerned about security:  any user on your 
system who can guess your port number can access your help system, so we 
want to be sure that such users can't access private files.


Duncan Murdoch
I very much enjoy the new help system and would be even more happy if 
that issue could be fixed.


Thomas Petzoldt


PS: A minimal reproducible example (foo_1.0.tar.gz) can be provided by 
mail if required.





__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] linking to package directories broken in R = 2.10 beta

2009-10-17 Thread Thomas Petzoldt

Duncan Murdoch wrote:

Thomas Petzoldt wrote:


[...]

This is fine, but in contrast to older versions (= 2.9.2) no 
automatic index is created for the linked directory, so we now get:



URL /library/foo/examples/ was not found

but linking to *individual files* (e.g. examples/example.R) works as
expected. We can, of course, add manually maintained index files
but I would much prefer if a default index would be created for the
directory if no index.html is found.



By index in R = 2.9.2, you mean the default directory listing 
produced by the web server, rather than something produced by R, 
right?


Yes, I mean the default directory listing produced by (most) web servers.

The R server does that now if the directory is named doc, but not 
for an arbitrary path. We are concerned about security: any user on 
your system who can guess your port number can access your help 
system, so we want to be sure that such users can't access private 
files.



Hmm, I see and have some tendency to understand that this may be an 
issue for certain multi-user systems. Looking into the svn log (and 
compiling R) it appears that the remaining possibilities where also 
regarded as security issue and are now locked down too.


Well, I'm not yet completely convinced that this was a good idea.

1) It does not completely solve security issues; what is so different
between the library/foo/doc and library/foo/examples ???

2) The change will introduce additional work for package authors
that used internal links within their packages. I can, of course,
reorganize everything below doc, e.g. /library/foo/doc/examples ... but
this means that these things are even more hidden.

3) However, according to the changed R-Exts, it was obviously decided
that this was necessary, so *I* will do the required reorganization.

I hope that other package authors accept this change of the rules too.

Nevertheless, thank you very much for the new help system.

Thomas P.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] linking to package directories is NOT broken in R = 2.10 beta

2009-10-17 Thread Prof Brian Ripley
When you linked to ../examples/ R was not involved, and what you are 
seeing is what your browser did with a file:// url.  Most browsers 
will support a wide range of file types, and list directories: but 
that is not something that was ever (AFAICS) documented to work.


The 'issue' is your expectations when creating your own 
inst/doc/index.html.  The only relative links that are supported by 
the help system are to R package help topics and files, to 
documentation under R.home(doc) and a limited set of files in a 
package's 'doc' directory to support its use for vignettes, including 
the ability to list 'doc' itself (if requested in a particular way).


If links to files under pkg/example worked, it was a bug. Because of 
security concerns over traffic snooping, what you can see through the 
dynamic help system is intentionally very limited.  In fact I suspect 
they worked for you only because


(i) you installed into .Library
(ii) you had a file for which text/plain worked (and that is because 
files that might be in a vignette directory have been checked)..
(iii) you fell into a code branch marked '# should not get here' in 
pre-2.10.0 (but absent in R-devel).


The good news is that if you refer to files under the installed 'doc' 
directory this should work -- subdirectory listings work now in 
R-devel and will probably be ported to 2.10.0 before release.



On Sat, 17 Oct 2009, Thomas Petzoldt wrote:


Dear R developers,

some of our packages come with additional programming examples in a directory 
called /examples which is created from /inst/examples.


This directory is linked from the docs (e.g. in inst/doc/index.html):

dl
dta href=../examples/examples/a:
ddSource code of examples
/dl

Given, that we have a package foo this is resolved to:

file:///C:/Programme/R/R-2.9.2/library/foo/examples/

with R = 2.9.2. With R 2.10 beta (R-beta_2009-10-16_r50118.tar.gz) and 
R-devel (svn rev. 50118) we get:


http://127.0.0.1:26383/library/foo/examples/

This is fine, but in contrast to older versions (= 2.9.2) no automatic index 
is created for the linked directory, so we now get:


URL /library/foo/examples/ was not found

bu linking to *individual files* (e.g. examples/example.R) works as expected. 
We can, of course, add manually maintained index files but I would much 
prefer if a default index would be created for the directory if no index.html 
is found.


I very much enjoy the new help system and would be even more happy if that 
issue could be fixed.


Thomas Petzoldt


PS: A minimal reproducible example (foo_1.0.tar.gz) can be provided by mail 
if required.


--
Thomas Petzoldt
Technische Universitaet Dresden
Institut fuer Hydrobiologiethomas.petzo...@tu-dresden.de
01062 Dresden  http://tu-dresden.de/hydrobiologie/
GERMANY

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel



--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] (PR#14012)

2009-10-17 Thread Seth Falcon
* On 2009-10-16 at 15:00 +0200 sj...@damtp.cam.ac.uk wrote:
 I think Rscript has a problem running files that have mac encodings
 for newline (^M rather than ^J on linux).  If I source the file within
 R, it works okay:

  source('j.R')
 [1] MEA_data/sernagor_new/CRX_P7_1.txt
 
 But if I run the file using Rscript on a linux box I get a strange
 error message: 
 
 $ Rscript --vanilla j.R
 
 Execution halted

I think you are right that Rscript is unhappy to handle files with CR
line terminators.  But IIUC, the purpose of Rscript is to enable R
script execution on unix-like systems like:

   #!/path/to/Rscript --vanilla
   print(1:10)

So then I'm not sure how useful it is for Rscript to handle such
files.  Why not convert to a more common and portable line termination
for your R script files?


+ seth

-- 
Seth Falcon | @sfalcon | http://userprimary.net/user

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] (PR#14012)

2009-10-17 Thread Gabor Grothendieck
Even though its not hard to convert files, I think it would be better
if R could directly handle different line endings since R tends to be
used in a cross platform way and its common to have files of different
line endings that originated from different systems.

On Sat, Oct 17, 2009 at 5:03 PM, Seth Falcon s...@userprimary.net wrote:
 * On 2009-10-16 at 15:00 +0200 sj...@damtp.cam.ac.uk wrote:
 I think Rscript has a problem running files that have mac encodings
 for newline (^M rather than ^J on linux).  If I source the file within
 R, it works okay:

  source('j.R')
 [1] MEA_data/sernagor_new/CRX_P7_1.txt

 But if I run the file using Rscript on a linux box I get a strange
 error message:

 $ Rscript --vanilla j.R
 
 Execution halted

 I think you are right that Rscript is unhappy to handle files with CR
 line terminators.  But IIUC, the purpose of Rscript is to enable R
 script execution on unix-like systems like:

   #!/path/to/Rscript --vanilla
   print(1:10)

 So then I'm not sure how useful it is for Rscript to handle such
 files.  Why not convert to a more common and portable line termination
 for your R script files?


 + seth

 --
 Seth Falcon | @sfalcon | http://userprimary.net/user

 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel


__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] R292 on AIX53 using gcc

2009-10-17 Thread Chuck White
I apologize for cross posting this message in the R-help group as well. Having 
posted it there a couple of hours ago, I felt this may be a more appropriate 
forum for a question of this type.


Hello -- I am unable to build R 2.9.2 on IBM PowerPC AIX5.3.  I would 
appreciate 
any help in this matter. 
 
===details== 
Machine:  IBM PowerPC_POWER5 / 4 proc, 1499 MHz 64-bit / AIX 5.3.0.0 
 
Building R 2.9.2 using gcc/g++/gfortran 4.2.4 
 
Config.site changes are: 
  OBJECT_MODE=64 
  CONFIG_SHELL=/usr/bin/bash 
  LIBICONV=/opt/freeware/lib 
  AR=ar -X64 
  CC=gcc -maix64 
  F77=gfortran -maix64 
  LDFLAGS=-L/opt/freeware/lib64 -L/opt/freeware/64/lib -L/opt/freeware/lib 
-L/usr/local/lib 
  CXX=g++ -maix64 
  FC=gfortran -maix64 
  R_BROWSER=/opt/freeware/bin/firefox 
  MAKE=/opt/freeware/bin/make 
 
 
Command for configure:  ./configure --enable-R-shlib 
 
Looks like I have to set OBJECT_MODE explicitly on the command line. So, I 
enter: set OBJECT_MODE=64.  It does not seem to help that I have it in 
config.site. 
 
make stops with the following error: 
 
 gcc -maix64 -std=gnu99 -Wl,-brtl -Wl,-bexpall -Wl,-bpT:0x1 
-Wl,-bpD:0x11000 -lc  -L/opt/freeware/lib64 -L/opt/freeware/64/lib 
-L/opt/freeware/lib -L/usr/local/lib -o R.bin Rmain.o -L../../lib -lR 
ld: 0711-224 WARNING: Duplicate symbol: .memcpy 
...duplicate symbol warning for: memcpy,bcopy,memset,fres 
ld: 0711-317 ERROR: Undefined symbol: R_running_as_main_program 
collect2: ld returned 8 exit status 
make: The error code from the last command is 1.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] (PR#14012)

2009-10-17 Thread Peter Dalgaard

Seth Falcon wrote:

* On 2009-10-16 at 15:00 +0200 sj...@damtp.cam.ac.uk wrote:

I think Rscript has a problem running files that have mac encodings
for newline (^M rather than ^J on linux).  If I source the file within
R, it works okay:



source('j.R')

[1] MEA_data/sernagor_new/CRX_P7_1.txt

But if I run the file using Rscript on a linux box I get a strange
error message: 


$ Rscript --vanilla j.R

Execution halted


I think you are right that Rscript is unhappy to handle files with CR
line terminators.  But IIUC, the purpose of Rscript is to enable R
script execution on unix-like systems like:

   #!/path/to/Rscript --vanilla
   print(1:10)

So then I'm not sure how useful it is for Rscript to handle such
files.  Why not convert to a more common and portable line termination
for your R script files?


Notice also that other script interpreters aren't happy about CR line 
endings:


$ cat  x.sh
#!/bin/bash
echo hello

Now change the LF to CR and get

$ ./x.sh
bash: ./x.sh: /bin/bash^M: bad interpreter: No such file or directory

or (if you add a space)

$ ./x.sh
 echo hello: No such file or directory

$ bash -v ./x.sh
 echo hello

(overprinting is involved in the last one).

--
   O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - (p.dalga...@biostat.ku.dk)  FAX: (+45) 35327907

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] (PR#14012)

2009-10-17 Thread Prof Brian Ripley

On Sat, 17 Oct 2009, Seth Falcon wrote:


* On 2009-10-16 at 15:00 +0200 sj...@damtp.cam.ac.uk wrote:

I think Rscript has a problem running files that have mac encodings
for newline (^M rather than ^J on linux).


I think those are Mac conventions for end-of-line, not for newline. 
Even in MacRoman encoding, Ctrl-M is carriage return and Ctrl-J is 
newline aka linefeed..



If I source the file within R, it works okay:



source('j.R')

[1] MEA_data/sernagor_new/CRX_P7_1.txt

But if I run the file using Rscript on a linux box I get a strange
error message:

$ Rscript --vanilla j.R

Execution halted


I think you are right that Rscript is unhappy to handle files with CR
line terminators.


More accurately, R's parser is: this applies to R CMD BATCH and R 
itself with redirection.  The point is that the documentation says
that R commands have to be separated by newline or semicolon and CR is 
neither.  (See, e.g. R-intro section 1.8.)


It is also documented that text-mode connections (which source() uses) 
map CR and CRLF to newline, so source() can accept CR-delimited files.


And the error message looks strange because it has CRs but not NLs in 
it (since the input did) and presumably the terminal used replaces not 
superposes characters.


What actually is claimed to be the bug here?  There is no subject 
line, and no clear statement.  Is that Rscript gives an error, that 
source() works or that the error message comes out mangled on a 
particular terminal?



But IIUC, the purpose of Rscript is to enable R script execution on 
unix-like systems like:


  #!/path/to/Rscript --vanilla
  print(1:10)

So then I'm not sure how useful it is for Rscript to handle such
files.  Why not convert to a more common and portable line termination
for your R script files?


+ seth

--
Seth Falcon | @sfalcon | http://userprimary.net/user

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel



--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Fortran with OpenMP

2009-10-17 Thread Fabio Mathias Corrêa
Dear,

I wrote a code in Fortran using OpenMP. When testing the code in Fortran it was 
working. However, changing the code for the R, it does not indicate the use of 
threads, it should indicate.
I know that the R accepts the directives of OpenMP, but I can not use them 
correctly in R.
Below is a small sample code that should work with the use of OpenMP, but does 
not work when I use the R. 

SUBROUTINE A1(N, A, B)
  INCLUDE omp_lib.h
  INTEGER :: I, N
  DOUBLE PRECISION, DIMENSION(N) :: B(N), A(N)
  LOGICAL :: OMP_IN_PARALLEL

!$OMP PARALLEL DO 
  WRITE(*,*) OMP_IN_PARALLEL()
!$OMP DO
  DO I=2,N
B(I) = (A(I) + A(I-1)) / 2.0
  ENDDO
!$OMP END DO
!$OMP END PARALLEL
END SUBROUTINE A1

# Compiling

R CMD SHLIB teste.f95 -o teste.so -fopenmp


# Output of the R

a - rnorm(10)
b - rnorm(10)
N - length(a)
dyn.load(teste.so)
.Fortran(A1, as.integer(n), as.double(a),as.double(b))

F# Should return TRUE and not FALSE

[[1]]
[1] 5

[[2]]
 [1] -1.0885364  0.4170852 -0.4627566  0.5662825 -1.9792053  1.0347733
 [7]  1.1615486  1.1752779  1.4337560 -0.2803431

[[3]]
 [1] -0.52768479 -0.33572564 -0.02283571  0.05176294 -0.70646140 -0.15066979
 [7] -0.82335438  1.20606866 -1.65533309  1.04965146


Somebody to say would know me where is the error?

Thank you very much!

   Fábio Mathias Corrêa
Estatística e Experimentação Agropecuária/UFLA



  

Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Rscript not returning zero

2009-10-17 Thread Rodrigo Flores
Hi

I'm trying to run a R script in a computer grid using the Rscript
interpreter, but the Rscript is not returning zero (even when the
scripts processes succesfully) on its exit which causes the scheduler
to detect an error and not records the output.

Is there any way to get the Rscript returning zero ?

-- 

A critical section of code is like a bathroom. Only one person is
allowed inside at once.

Iker Gondra, Operating Systems
St. Francis Xavier University, Antigonish, NS

===
Rodrigo L. M. Flores
Computer Science Student - IME - USP
Homepage (en): http://www.rodrigoflores.org
Blog (pt-BR): http://blog.rodrigoflores.org
Linux User # : 351304
Jabber: i...@rodrigoflores.org

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Rscript not returning zero

2009-10-17 Thread Prof Brian Ripley

On Sat, 17 Oct 2009, Rodrigo Flores wrote:


Hi

I'm trying to run a R script in a computer grid using the Rscript
interpreter, but the Rscript is not returning zero (even when the
scripts processes succesfully) on its exit which causes the scheduler
to detect an error and not records the output.

Is there any way to get the Rscript returning zero ?


Have a successful script 

You have not told us the 'at a minimum' information asked for in the 
posting guide, whereas I get (under sh)


sh-3.2$ Rscript -e 'sessionInfo()'
R version 2.9.2 (2009-08-24)
x86_64-unknown-linux-gnu

locale:
LC_CTYPE=en_GB.utf8;LC_NUMERIC=C;LC_TIME=en_GB.utf8;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=en_GB.utf8;LC_PAPER=en_GB.utf8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_GB.utf8;LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics  grDevices utils datasets  base
sh-3.2$ echo $?
0

so please give a reproducible example of a successful script not 
returning zero.



Rodrigo L. M. Flores
Computer Science Student - IME - USP
Homepage (en): http://www.rodrigoflores.org
Blog (pt-BR): http://blog.rodrigoflores.org



--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel