Re: [Rd] zero variance in part of a glm (PR#11355)

2008-05-04 Thread Peter Dalgaard

[EMAIL PROTECTED] wrote:

In this real example (below), all four of the replicates in one
treatment combination had zero failures, and this produced a very high
standard error in the summary.lm.
  

Why are you reporting trouble with your own understanding as a bug in R?

I don't see anything out of the ordinary here. In the first case you 
have divergence, not because of a zero variance, but because you are 
trying to estimate an infinite value for the linear predictor  (l = 
logit(1) for the combination where everyone dies). This will also happen 
if you fit an ordinary logistic regression, whenever you have 0s in the 
y*antibio*toxin marginal table.



=20
Just adding one failure to one of the replicates produced a well-behaved
standard error.
=20
I don't know if this is a bug, but it is certainly hard for users to
understand.
=20
I would value your comments=20
=20
Thanks
=20
Best wishes,
=20
Mick
=20
Prof  M.J. Crawley
=20
Imperial College London
Silwood Park
Ascot
Berks
SL5 7PY
UK
=20
Phone (0) 207 5942 216
Fax (0) 207 5942 339
=20
The data are from a bioassay in which a factorial experiment with two
factors (antibio and toxin) each with three levels was replicated four
times. The response is "mi" and "n-mi"
=20
Note that lines 17 to 20 in the dataframe have no failures (24 dead out
of 24 individuals)

data<-read.table("c:\\temp\\ab1.txt",header=3DT)
attach(data)
names(data)
=20
[1] "antibio" "toxin"   "rep" "alive"   "af"  "dead""mi"

[8] "n"=20=20=20=20
=20
data
=20
=20
=20
   antibio   toxin rep alive af dead mi  n
1 camp control   124  00  0 24
2 camp control   223  01  1 24
3 camp control   323  01  1 24
4 camp control   421  03  3 24
5 camp  Cry1Ab   121  43  7 24
6 camp  Cry1Ab   220  34  7 24
7 camp  Cry1Ab   320  44  8 24
8 camp  Cry1Ab   418  76 13 24
9 camp   Vip3A   1 7  3   17 20 24
10camp   Vip3A   210  6   14 20 24
11camp   Vip3A   311  5   13 18 24
12camp   Vip3A   410  2   14 16 24
13   bcock control   121  03  3 24
14   bcock control   224  00  0 24
15   bcock control   324  30  3 24
16   bcock control   423  11  2 24
17   bcock  Cry1Ab   1 4  4   20 24 24
18   bcock  Cry1Ab   2 4  4   20 24 24
19   bcock  Cry1Ab   3 1  1   23 24 24
20   bcock  Cry1Ab   4 2  2   22 24 24
21   bcock   Vip3A   111  4   13 17 24
22   bcock   Vip3A   215  59 14 24
23   bcock   Vip3A   3 5  3   19 22 24
24   bcock   Vip3A   410  6   14 20 24
25 ana control   123  01  1 24
26 ana control   223  01  1 24
27 ana control   322  02  2 24
28 ana control   423  01  1 24
29 ana  Cry1Ab   118  16  7 24
30 ana  Cry1Ab   217  47 11 24
31 ana  Cry1Ab   313  4   11 15 24
32 ana  Cry1Ab   414  3   10 13 24
33 ana   Vip3A   121 123 15 24
34 ana   Vip3A   212  6   12 18 24
35 ana   Vip3A   3 9  5   15 20 24
36 ana   Vip3A   4 9  1   15 16 24
=20
y<-cbind(mi,n-mi)
model<-glm(y~antibio*toxin,quasibinomial)
summary(model)
=20

Call:
glm(formula =3D y ~ antibio * toxin, family =3D quasibinomial)
=20
Deviance Residuals:=20
Min   1Q   Median   3Q  Max=20=20
-2.0437  -0.5645  -0.1022   0.6921   1.9996=20=20
=20
Coefficients:
   Estimate Std. Error  t value Pr(>|t|)=20=20=20=
=20
(Intercept)  -2.901e+00  5.020e-01   -5.780 3.79e-06 ***
antibiobcock  5.035e-01  6.441e-010.7820.441=20=20=20=
=20
antibiocamp   2.100e-15  7.099e-01 2.96e-151.000=20=20=20=
=20
toxinCry1Ab   2.818e+00  5.494e-015.129 2.15e-05 ***
toxinVip3A3.840e+00  5.600e-016.857 2.29e-07 ***
antibiobcock:toxinCry1Ab  2.050e+01  2.365e+030.0090.993=20=20=20=
=20
antibiocamp:toxinCry1Ab  -4.721e-01  7.795e-01   -0.6060.550=20=20=20=
=20
antibiobcock:toxinVip3A  -2.868e-01  7.381e-01   -0.3890.701=20=20=20=
=20
antibiocamp:toxinVip3A2.748e-01  7.975e-010.3450.733=20=20=20=
=20
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1=20
=20
(Dispersion parameter for quasibinomial family taken to be 1.19442)
=20
Null deviance: 515.115  on 35  degrees of freedom
Residual deviance:  35.047  on 27  degrees of freedom
AIC: NA
=20
Number of Fisher Scoring iterations: 17
=20
# note the standard error of the firast interaction term =3D 2365)
=20
# add a single failure to one replicate
=20
y2<-y
y2[17,]<-c(23,1)
model2<-glm(y2~antibio*toxin,quasibinomial)
summary(model2)
=20
Call:
glm(formula =3D y2 ~ antibio * toxin, family =3D quasibinomial)
=20
Deviance Residuals:=20
   Min  1Q  Median  3Q Max=20=20
-2.044  -0.627  -0.221   0.709   2.000=20=20
=20
Coefficients:
   Estimate Std. Error   t value Pr(>|t|)=20=20=20=
=20
(Intercept)  -2.90

Re: [Rd] error with R-patched (2008-05-02 r45591)

2008-05-04 Thread Peter Dalgaard

Prof Brian Ripley wrote:

From the NEWS file for R-patchd:


BUG FIXES

oThe parser sometimes accepted invalid quoted strings in a UTF-8
locale.

This is likely to be the issue, but we still don't have a reproducible 
example (see the posting guide).


As Brian probably already knows, the issue is likely to be that your 
source file is in a non-UTF-8 encoding. (Emacs has become a little too 
smooth in handling such files almost invisibly. The magic incantation is


C-x RET f utf-8

before saving.)

It can be reproduces as follows:

[EMAIL PROTECTED] ~]$ cat > xxx.R
"æøå"
[EMAIL PROTECTED] ~]$ iconv -t latin1 xxx.R > .R

and then R-patched gives

> source("~/.R")
Error in source("~/.R") :
 invalid multibyte character in mbcs_get_next at line 1

whereas R-2.6.2 gives

> source(".R")
> .Last.value
$value
[1] "\xe6\xf8\xe5"

$visible
[1] TRUE







On Sat, 3 May 2008, Mark Kimpel wrote:


I have found the cause of the problem I am having with R-patched. In my
.Rprofile I have a function that loads a bunch of my own functions, one
of which contains the character "®". No other version of R I have used
since writing this function ~2 yrs. ago has had a problem reading in 
this

character, but apparently R-patched does (invalid multibyte character in
mbcs_get_next at line 17).


That is a parser error message.


Has something intentional or unintentional
occured to cause this? I suspect unintentional since this would seem to
be a loss of functionalilty unlikely to be introduced in a patch of a
release.

Anyway, that's the issue, R-patched doesn't like "®".


I get


"®"

[1] "®"

in R-patched in UTF-8.



Mark


On Sat, May 3, 2008 at 4:20 PM, Prof Brian Ripley 
<[EMAIL PROTECTED]>

wrote:
  On Sat, 3 May 2008, Mark Kimpel wrote:

Just installed the latest R-patched and get the
error seen at the end of the
output below. Don't know what to make of this but
thought I should report
it.


Nor do we.  You have something incorrect in your startup files, but
we don't have those.

  In general, when installing the latest version of R,
  should one use
  R-latest or R-patched? R-latest is stable, but one
  would assume that
  R-patched includes the latest bug fixes.


And you terminolgy is from where?  (Not e.g. the R FAQ.)

Mark

mkimpel-m90 ~/R_HOME/R-patched/R-build/bin: ./R

R version 2.7.0 Patched (2008-05-02 r45591)
Copyright (C) 2008 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

 Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

Loading required package: utils
[1] "packages do not need updated"
Error in source(source.files[i]) :
 invalid multibyte character in mbcs_get_next at line 17
[Previously saved workspace restored]

  sessionInfo()

R version 2.7.0 Patched (2008-05-02 r45591)
x86_64-unknown-linux-gnu

locale:
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_ 

MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;L 


C_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C

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


--
Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry
Indiana University School of Medicine

15032 Hunter Court, Westfield, IN 46074

(317) 490-5129 Work, & Mobile & VoiceMail
(317) 663-0513 Home (no voice mail please)

**

   [[alternative HTML version deleted]]

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


--
Brian D. Ripley,  [EMAIL PROTECTED]
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




--
Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry
Indiana University School of Medicine

15032 Hunter Court, Westfield, IN 46074

(317) 490-5129 Work, & Mobile & VoiceMail
(317) 663-0513 Home (no voice mail please)

**





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



--
  O

[Rd] Change in the Tcl/Tk loading in R 2.7.0 (under Unix/Mac OS X)?

2008-05-04 Thread Philippe Grosjean

Hello,

Up to R 2.6.2, I used to start Tcl *without Tk* (I need only Tcl for 
some part of my work, like a socket server written in Tcl only, for 
instance) with this code under Mac OS X (particularly on this system, 
because I don't want to start X11 just to use Tcl code, which is 
required for Tk!):


> Sys.unsetenv("DISPLAY")
> library(tcltk)

I got then the message "no DISPLAY variable so Tk is not available", but 
could work with Tcl without problems.


Now, with R 2.7.0, I got the following and Tcl failed to load:
Loading Tcl/Tk interface ... Error in fun(...) : no display name and no 
$DISPLAY environment variable

Error : .onLoad failed in 'loadNamespace' for 'tcltk'
Error: package/namespace load failed for 'tcltk'

I try to locate the message "no display name and no $DISPLAY environment 
variable" in the code but I cannot find it. Could someone help me please?


> sessionInfo()
R version 2.7.0 Patched (2008-04-22 r45460)
i386-apple-darwin8.10.1

locale:
en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

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

Many thanks,

Philippe Grosjean
--
..<°}))><
 ) ) ) ) )
( ( ( ( (Prof. Philippe Grosjean
 ) ) ) ) )
( ( ( ( (Numerical Ecology of Aquatic Systems
 ) ) ) ) )   Mons-Hainaut University, Belgium
( ( ( ( (
..

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


Re: [Rd] Change in the Tcl/Tk loading in R 2.7.0 (under Unix/Mac OS X)?

2008-05-04 Thread Prof Brian Ripley
First, this does depend on what build of R you use.  The 'HAVE_AQUA' 
define matters, and is only defined on some Mac OS X builds (e.g. not the 
default one, but the one used for the CRAN binary).


Second, there are several possible versions of Tcl/Tk and X11 on MacOS X, 
and as I suspect one of your R versions was not a CRAN build, I am not 
willing to make assumptions here.  (E.g. I do run a self-compiled 
command-line version of R using ActiveTcl's 8.5.2 code.)


Finally, I see no evidence that this is not specific to Mac OS X, and your 
desired behaviour is still present on other Unix-alikes.


If you want the ability to start Tcl and not Tk on a CRAN build of R for 
Mac OS X, I think you need to negotiate a way to do it as I believe it is 
not intended to be available.  But that's definitely an R-sig-mac topic.


On Sun, 4 May 2008, Philippe Grosjean wrote:


Hello,

Up to R 2.6.2, I used to start Tcl *without Tk* (I need only Tcl for some 
part of my work, like a socket server written in Tcl only, for instance) with 
this code under Mac OS X (particularly on this system, because I don't want 
to start X11 just to use Tcl code, which is required for Tk!):



Sys.unsetenv("DISPLAY")
library(tcltk)


I got then the message "no DISPLAY variable so Tk is not available", but 
could work with Tcl without problems.


That message is only given if (src/library/tcltk/src/tcltk.c in both 2.6.2 
and 2.7.0)


#if !defined(Win32) && !defined(HAVE_AQUA)

so your 2.6.x build appears not to have been defining HAVE_AQUA, which a 
CRAN build would.



Now, with R 2.7.0, I got the following and Tcl failed to load:
Loading Tcl/Tk interface ... Error in fun(...) : no display name and no 
$DISPLAY environment variable

Error : .onLoad failed in 'loadNamespace' for 'tcltk'
Error: package/namespace load failed for 'tcltk'

I try to locate the message "no display name and no $DISPLAY environment 
variable" in the code but I cannot find it. Could someone help me please?


I think it is coming from Tk_Init, at

code = Tk_Init(RTcl_interp);  /* Load Tk into interpreter */
if (code != TCL_OK)
error(Tcl_GetStringResult(RTcl_interp));


sessionInfo()

R version 2.7.0 Patched (2008-04-22 r45460)
i386-apple-darwin8.10.1

locale:
en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

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

Many thanks,

Philippe Grosjean
--
..<°}))><
) ) ) ) )
( ( ( ( (Prof. Philippe Grosjean
) ) ) ) )
( ( ( ( (Numerical Ecology of Aquatic Systems
) ) ) ) )   Mons-Hainaut University, Belgium
( ( ( ( (
..

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



--
Brian D. Ripley,  [EMAIL PROTECTED]
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] Change in the Tcl/Tk loading in R 2.7.0 (under Unix/Mac OS X)?

2008-05-04 Thread Philippe Grosjean

Prof Brian Ripley wrote:
First, this does depend on what build of R you use.  The 'HAVE_AQUA' 
define matters, and is only defined on some Mac OS X builds (e.g. not 
the default one, but the one used for the CRAN binary).


Second, there are several possible versions of Tcl/Tk and X11 on MacOS 
X, and as I suspect one of your R versions was not a CRAN build, I am 
not willing to make assumptions here.  (E.g. I do run a self-compiled 
command-line version of R using ActiveTcl's 8.5.2 code.)


Finally, I see no evidence that this is not specific to Mac OS X, and 
your desired behaviour is still present on other Unix-alikes.


Indeed!

If you want the ability to start Tcl and not Tk on a CRAN build of R for 
Mac OS X, I think you need to negotiate a way to do it as I believe it 
is not intended to be available.  But that's definitely an R-sig-mac topic.


OK, thanks. I repost this question to r-sig-mac.

Philippe


On Sun, 4 May 2008, Philippe Grosjean wrote:


Hello,

Up to R 2.6.2, I used to start Tcl *without Tk* (I need only Tcl for 
some part of my work, like a socket server written in Tcl only, for 
instance) with this code under Mac OS X (particularly on this system, 
because I don't want to start X11 just to use Tcl code, which is 
required for Tk!):



Sys.unsetenv("DISPLAY")
library(tcltk)


I got then the message "no DISPLAY variable so Tk is not available", 
but could work with Tcl without problems.


That message is only given if (src/library/tcltk/src/tcltk.c in both 
2.6.2 and 2.7.0)


#if !defined(Win32) && !defined(HAVE_AQUA)

so your 2.6.x build appears not to have been defining HAVE_AQUA, which a 
CRAN build would.



Now, with R 2.7.0, I got the following and Tcl failed to load:
Loading Tcl/Tk interface ... Error in fun(...) : no display name and 
no $DISPLAY environment variable

Error : .onLoad failed in 'loadNamespace' for 'tcltk'
Error: package/namespace load failed for 'tcltk'

I try to locate the message "no display name and no $DISPLAY 
environment variable" in the code but I cannot find it. Could someone 
help me please?


I think it is coming from Tk_Init, at

code = Tk_Init(RTcl_interp);  /* Load Tk into interpreter */
if (code != TCL_OK)
error(Tcl_GetStringResult(RTcl_interp));


sessionInfo()

R version 2.7.0 Patched (2008-04-22 r45460)
i386-apple-darwin8.10.1

locale:
en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

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

Many thanks,

Philippe Grosjean
--
..<°}))><
) ) ) ) )
( ( ( ( (Prof. Philippe Grosjean
) ) ) ) )
( ( ( ( (Numerical Ecology of Aquatic Systems
) ) ) ) )   Mons-Hainaut University, Belgium
( ( ( ( (
..

__
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] R CMD check: small tests suggestion

2008-05-04 Thread hadley wickham
> > It would be nice if R CMD check ran any file in the tests directory
> > that has "one of the extensions .R, .S, .q, .r, or .s" - i.e. it
> > should match the files processed in the R directory.
> >
>
>  Whereas what it is documented in 'Writing R Extensions' is to use .R or
> .Rin files.  This leaves the other extensions available for other purposes
> -- the difference is that there should be no other files in the R directory,
> but often will be in the tests directory.
>
>  I have some sympathy for .r (which we allow for demos) given the prevalence
> of case-insensitive file systems, but why would it be 'nice' to have the
> others?  And what would the output file be called?  Should .S be processed
> to .Sout and matched to a .Sout.save file?  This would seem to introduce
> more confusion that it might remove.

Those are good points - .r is the extension that I really want as it
would have saved me much frustration trying to figure out why my tests
weren't running.  An alternative would be to report

* checking tests ...
  No test files found

rather than

* checking tests ...
  OK

in the case in which there are no files run in the tests directory.

Hadley


-- 
http://had.co.nz/

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


[Rd] A patch for extending pdf device to embed popup text and web links

2008-05-04 Thread Tadashi Kadowaki
Dear all,

I am sending a patch for R-2.7.0 for extending pdf device to embed pop
up text and
web links. The patch is available at
http://www.okada.jp.org/RWiki/?plugin=attach&pcmd=open&file=R-2.7.0.patch&refer=pdf%20device%20patch
You can see what the patch can do through a sample output, which is available at
http://www.okada.jp.org/RWiki/?plugin=attach&pcmd=open&file=sample2.pdf&refer=pdf%20device%20patch
An script is at
http://www.okada.jp.org/RWiki/?plugin=attach&pcmd=open&file=sample2.r&refer=pdf%20device%20patch

Ei-ji Nakama kindly build Windows binary, which can be obtained from
http://prs.ism.ac.jp/~nakama/tadakadosan/cran/
An installer, R-2.7.0pat-win32.exe, will install programs in
C:\Program Files\R\R-2.7.0pat
so that you can use both of original and patched version simultaneously.

Regards,

Tadashi Kadowaki

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


Re: [Rd] A patch for extending pdf device to embed popup text and web links

2008-05-04 Thread Tobias Verbeke

Dear Tadashi,

Thank you very much for sharing your work.


I am sending a patch for R-2.7.0 for extending pdf device to embed pop
up text and
web links. The patch is available at
http://www.okada.jp.org/RWiki/?plugin=attach&pcmd=open&file=R-2.7.0.patch&refer=pdf%20device%20patch
You can see what the patch can do through a sample output, which is available at
http://www.okada.jp.org/RWiki/?plugin=attach&pcmd=open&file=sample2.pdf&refer=pdf%20device%20patch
An script is at
http://www.okada.jp.org/RWiki/?plugin=attach&pcmd=open&file=sample2.r&refer=pdf%20device%20patch

Ei-ji Nakama kindly build Windows binary, which can be obtained from
http://prs.ism.ac.jp/~nakama/tadakadosan/cran/
An installer, R-2.7.0pat-win32.exe, will install programs in
C:\Program Files\R\R-2.7.0pat
so that you can use both of original and patched version simultaneously.


I think it would be most useful if you could bundle your patched version
of the pdf device in a separate device package, similar to the
RSVGTipsDevice.

What do you think ?

Kind regards,
Tobias

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


[Rd] S4 / S3 / Sweave problem

2008-05-04 Thread Paul Gilbert
I'm not sure if this as a bug or something I am doing wrong. It occurs 
in both 2.7.0 and 2.6.2.


require("methods")

setClassUnion("OptionalPOSIXct",   c("POSIXct",   "NULL"))

setClass("TSmetax",
  representation(serIDs="character", ExtractionDate="OptionalPOSIXct" ))

setGeneric("TSmetax",
   def= function(x, ...) standardGeneric("TSmetax"))

setMethod("TSmetax",   signature(x="character"),
   definition= function(x, ...){
   new("TSmetax", serIDs=x, ExtractionDate=Sys.time())
   } )

> z <- new("TSmetax", serIDs="whatever", ExtractionDate= NULL)
> print(z)
An object of class "TSmetax"
Slot "serIDs":
[1] "whatever"

Slot "ExtractionDate":
NULL

Now if I make this an attribute of an S3 class an print, I get
> zz <- ts(1:10)
> attr(zz, "Meta") <- z
> print(zz)
Time Series:
Start = 1
End = 10
Frequency = 1
 [1]  1  2  3  4  5  6  7  8  9 10
attr(,"Meta")

attr(,"serIDs")
[1] "whatever"
attr(,"ExtractionDate")
`NULL`
attr(,"class")
[1] "TSmetax"
attr(,"class")attr(,"package")
[1] ".GlobalEnv"
>

The `NULL` shows up i
 shows up in the tex file generated by a vignette as
NULL which causes  tex (pdftex) to throw an  error.
(It also seems to mess up my mail tool, so I hope this goes through.)

Paul


La version française suit le texte anglais.



This email may contain privileged and/or confidential in...{{dropped:26}}

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


Re: [Rd] S4 / S3 / Sweave problem

2008-05-04 Thread Prof Brian Ripley
I'm not sure what the issue being asked about here is.  The peculiar 
printing I don't see and may well be a locale issue.  (Is this UTF-8 and 
TeX has not been told so?)


The other issue is that when printing an object with attributes, there is 
no consideration of S4 classes amongst the attributes.  That was either an 
undocumented design decision or an omission.  This is different from



print(attributes(zz))

$tsp
[1]  1 10  1

$class
[1] "ts"

$Meta
An object of class “TSmetax”
Slot "serIDs":
[1] "whatever"

Slot "ExtractionDate":
NULL

since although attributes are internally a pairlist and printed by a 
special C function, attributes() returns a list.


It would be fairly easy to include a branch for S4 objects, but there are 
ambuiguities still over what they are (I wrote up a set of questions over 
a year ago about this).  But it would seem fairly safe to send them to 
show() in the same circumstances that autoprinting does for apparently S4 
objects.


On Sun, 4 May 2008, Paul Gilbert wrote:

I'm not sure if this as a bug or something I am doing wrong. It occurs in 
both 2.7.0 and 2.6.2.


My guess is that it was never intended that S4 objects be used as
attributes, in the same way that one of the unanswered questions is if S4
objects should be allowed to have attributes (other than slots).



require("methods")

setClassUnion("OptionalPOSIXct",   c("POSIXct",   "NULL"))

setClass("TSmetax",
 representation(serIDs="character", ExtractionDate="OptionalPOSIXct" ))

setGeneric("TSmetax",
  def= function(x, ...) standardGeneric("TSmetax"))

setMethod("TSmetax",   signature(x="character"),
  definition= function(x, ...){
  new("TSmetax", serIDs=x, ExtractionDate=Sys.time())
  } )


z <- new("TSmetax", serIDs="whatever", ExtractionDate= NULL)
print(z)

An object of class "TSmetax"
Slot "serIDs":
[1] "whatever"

Slot "ExtractionDate":
NULL

Now if I make this an attribute of an S3 class an print, I get

zz <- ts(1:10)
attr(zz, "Meta") <- z
print(zz)

Time Series:
Start = 1
End = 10
Frequency = 1
[1]  1  2  3  4  5  6  7  8  9 10
attr(,"Meta")

attr(,"serIDs")
[1] "whatever"
attr(,"ExtractionDate")
`NULL`
attr(,"class")
[1] "TSmetax"
attr(,"class")attr(,"package")
[1] ".GlobalEnv"




The `NULL` shows up i
shows up in the tex file generated by a vignette as
NULL which causes  tex (pdftex) to throw an  error.
(It also seems to mess up my mail tool, so I hope this goes through.)



--
Brian D. Ripley,  [EMAIL PROTECTED]
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] ~/.Rprofile executed twice by R.app under Mac OS X (PR#11380)

2008-05-04 Thread phgrosjean
All is in the title. My config is:
Version:
  platform = i386-apple-darwin8.10.1
  arch = i386
  os = darwin8.10.1
  system = i386, darwin8.10.1
  status =
  major = 2
  minor = 7.0
  year = 2008
  month = 04
  day = 22
  svn rev = 45424
  language = R
  version.string = R version 2.7.0 (2008-04-22)

GUI:
  R-GUI 1.24 (5102)

Locale:
en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

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

-- 
..<°}))><
  ) ) ) ) )
( ( ( ( (Prof. Philippe Grosjean
  ) ) ) ) )
( ( ( ( (Numerical Ecology of Aquatic Systems
  ) ) ) ) )   Mons-Hainaut University, Belgium
( ( ( ( (
..

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


[Rd] help with segmentation fault

2008-05-04 Thread Kyeongmi Cheon
Hello all,
I'm trying to have C called by R. I wrote C codes that worked
perfectly fine with R-2.6.0 in

windows system ( using R tools).

I had to change to SuSE Linux (this system has 3.2 GHz  Intel

Xeon processors and 4 GB of RAM), the C codes were compiled okay but
when it was called to R-2.6.2, I got

error mesage :


***caught segfault***
address 0x1df5000, cause 'memory not mapped'
segmentation fault



According to C references, this kind of error occurs when you get
something wrong with

dereferencing pointers or go out of edge of arrays. But the very same
codes were fine in windows

and I did not find any related errors in my codes. How could this
happen and how can I fix it? Does this have to do with different
systems (linux vs windows) or C/R program?

Thank you in advance.
-- 
Kyeongmi
Univ. Memphis

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


Re: [Rd] help with segmentation fault

2008-05-04 Thread Oleg Sklyar

Katie,

99% it's a bug in your C code caused by accessing memory (probably 
writing to) which was not allocated or freed already or out of boundary. 
 The fact that it worked fine on Windows is likely to be a pure 
coincidence of different compiler/optimisation settings. However, the 
main problem is that segfault is such a generic error that without 
looking at the code one will not be able to tell you anything.


Debug it, get ddd with gdb and go step-wise or introduce lots of 
pritouts to nail down the location of the problem.


Oleg

Kyeongmi Cheon wrote:

Hello all,
I'm trying to have C called by R. I wrote C codes that worked
perfectly fine with R-2.6.0 in

windows system ( using R tools).

I had to change to SuSE Linux (this system has 3.2 GHz  Intel

Xeon processors and 4 GB of RAM), the C codes were compiled okay but
when it was called to R-2.6.2, I got

error mesage :


***caught segfault***
address 0x1df5000, cause 'memory not mapped'
segmentation fault



According to C references, this kind of error occurs when you get
something wrong with

dereferencing pointers or go out of edge of arrays. But the very same
codes were fine in windows

and I did not find any related errors in my codes. How could this
happen and how can I fix it? Does this have to do with different
systems (linux vs windows) or C/R program?

Thank you in advance.


--
Dr Oleg Sklyar * EBI-EMBL, Cambridge CB10 1SD, UK * +44-1223-494466

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


Re: [Rd] help with segmentation fault

2008-05-04 Thread Kasper Daniel Hansen
One thing that may help with debugging (and seeing if you get the same  
error on windows) is to run your code with

  R> gctorture(TRUE)
  R> your.function()

That way everything is garbage collected all the time so to speak and  
this may trigger an error on your windows machine.


I agree with Oleg - in my experience it is always a user error. You  
could also try to compile it with warnings set high(er).


Kasper

On May 4, 2008, at 2:19 PM, Oleg Sklyar wrote:


Katie,

99% it's a bug in your C code caused by accessing memory (probably  
writing to) which was not allocated or freed already or out of  
boundary.  The fact that it worked fine on Windows is likely to be a  
pure coincidence of different compiler/optimisation settings.  
However, the main problem is that segfault is such a generic error  
that without looking at the code one will not be able to tell you  
anything.


Debug it, get ddd with gdb and go step-wise or introduce lots of  
pritouts to nail down the location of the problem.


Oleg

Kyeongmi Cheon wrote:

Hello all,
I'm trying to have C called by R. I wrote C codes that worked
perfectly fine with R-2.6.0 in
windows system ( using R tools).
I had to change to SuSE Linux (this system has 3.2 GHz  Intel
Xeon processors and 4 GB of RAM), the C codes were compiled okay but
when it was called to R-2.6.2, I got
error mesage :
***caught segfault***
address 0x1df5000, cause 'memory not mapped'
segmentation fault
According to C references, this kind of error occurs when you get
something wrong with
dereferencing pointers or go out of edge of arrays. But the very same
codes were fine in windows
and I did not find any related errors in my codes. How could this
happen and how can I fix it? Does this have to do with different
systems (linux vs windows) or C/R program?
Thank you in advance.


--
Dr Oleg Sklyar * EBI-EMBL, Cambridge CB10 1SD, UK * +44-1223-494466

__
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] A patch for extending pdf device to embed popup text and web links

2008-05-04 Thread Paul Murrell
Hi


Tobias Verbeke wrote:
> Dear Tadashi,
> 
> Thank you very much for sharing your work.
> 
>> I am sending a patch for R-2.7.0 for extending pdf device to embed pop
>> up text and
>> web links. The patch is available at
>> http://www.okada.jp.org/RWiki/?plugin=attach&pcmd=open&file=R-2.7.0.patch&refer=pdf%20device%20patch
>> You can see what the patch can do through a sample output, which is 
>> available at
>> http://www.okada.jp.org/RWiki/?plugin=attach&pcmd=open&file=sample2.pdf&refer=pdf%20device%20patch
>> An script is at
>> http://www.okada.jp.org/RWiki/?plugin=attach&pcmd=open&file=sample2.r&refer=pdf%20device%20patch
>>
>> Ei-ji Nakama kindly build Windows binary, which can be obtained from
>> http://prs.ism.ac.jp/~nakama/tadakadosan/cran/
>> An installer, R-2.7.0pat-win32.exe, will install programs in
>> C:\Program Files\R\R-2.7.0pat
>> so that you can use both of original and patched version simultaneously.
> 
> I think it would be most useful if you could bundle your patched version
> of the pdf device in a separate device package, similar to the
> RSVGTipsDevice.


I would second that approach, at least in the meantime.  This sort of
functionality is interesting and useful, but needs careful thought to
make it compatible with the existing graphics facilities in R.

One major consideration is that the graphics system tries to be mostly
device-independent, so that R graphics code can be run on any device.
This would need adjustments to the common graphics engine/device C code
rather than just to the C code underlying the PDF device.

There is also the issue of following standard R coding style and
semantics.  Rather than your approach of ...

text(5, 2, "text test")
pdf.link.on.text("http://www.google.com";)

... where the second call relies on a global setting to relate to the
appropriate text, it would be better to have something like ...

linkedText(5, 2, "text test", href="http://www.google.com";)

... so that the association is explicit.

By developing your ideas as an add-on package, people can try out your
ideas without having to recompile R.  As Tobias has pointed out, the
RSVGTipsDevice package might be a good place to start.

Paul



> What do you think ?
> 
> Kind regards,
> Tobias
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
[EMAIL PROTECTED]
http://www.stat.auckland.ac.nz/~paul/

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


Re: [Rd] S4 / S3 / Sweave problem

2008-05-04 Thread Paul Gilbert



Prof Brian Ripley wrote:
I'm not sure what the issue being asked about here is.  The peculiar 
printing I don't see and may well be a locale issue.  (Is this UTF-8 and 
TeX has not been told so?)


It seems to happen in locales UTF-8, POSIX and C.  I have not tried others.



The other issue is that when printing an object with attributes, there 
is no consideration of S4 classes amongst the attributes.  That was 
either an undocumented design decision or an omission.  This is 
different from



print(attributes(zz))

$tsp
[1]  1 10  1

$class
[1] "ts"

$Meta
An object of class “TSmetax”
Slot "serIDs":
[1] "whatever"

Slot "ExtractionDate":
NULL

since although attributes are internally a pairlist and printed by a 
special C function, attributes() returns a list.


It would be fairly easy to include a branch for S4 objects, but there 
are ambuiguities still over what they are (I wrote up a set of questions 
over a year ago about this).  But it would seem fairly safe to send them 
to show() in the same circumstances that autoprinting does for 
apparently S4 objects.


Yes, I do have the impression that print() does not do exactly what one 
might like when it finds an S4 attribute in an S3 object. I hope this is 
not a design decision. It would make it very difficult to migrate toward 
S4 if it is not possible to include S4 objects in S3 objects this way.


On Sun, 4 May 2008, Paul Gilbert wrote:

I'm not sure if this as a bug or something I am doing wrong. It occurs 
in both 2.7.0 and 2.6.2.


My guess is that it was never intended that S4 objects be used as
attributes, in the same way that one of the unanswered questions is if S4
objects should be allowed to have attributes (other than slots).



require("methods")

setClassUnion("OptionalPOSIXct",   c("POSIXct",   "NULL"))

setClass("TSmetax",
 representation(serIDs="character", ExtractionDate="OptionalPOSIXct" ))

setGeneric("TSmetax",
  def= function(x, ...) standardGeneric("TSmetax"))

setMethod("TSmetax",   signature(x="character"),
  definition= function(x, ...){
  new("TSmetax", serIDs=x, ExtractionDate=Sys.time())
  } )


z <- new("TSmetax", serIDs="whatever", ExtractionDate= NULL)
print(z)

An object of class "TSmetax"
Slot "serIDs":
[1] "whatever"

Slot "ExtractionDate":
NULL

Now if I make this an attribute of an S3 class an print, I get

zz <- ts(1:10)
attr(zz, "Meta") <- z
print(zz)

Time Series:
Start = 1
End = 10
Frequency = 1
[1]  1  2  3  4  5  6  7  8  9 10
attr(,"Meta")

attr(,"serIDs")
[1] "whatever"
attr(,"ExtractionDate")
`NULL`
attr(,"class")
[1] "TSmetax"
attr(,"class")attr(,"package")
[1] ".GlobalEnv"




The `NULL` shows up i
shows up in the tex file generated by a vignette as
NULL which causes  tex (pdftex) to throw an  error.
(It also seems to mess up my mail tool, so I hope this goes through.)






La version française suit le texte anglais.



This email may contain privileged and/or confidential information, and the Bank 
of
Canada does not waive any related rights. Any distribution, use, or copying of 
this
email or the information it contains by other than the intended recipient is
unauthorized. If you received this email in error please delete it immediately 
from
your system and notify the sender promptly by email that you have done so. 




Le présent courriel peut contenir de l'information privilégiée ou 
confidentielle.
La Banque du Canada ne renonce pas aux droits qui s'y rapportent. Toute 
diffusion,
utilisation ou copie de ce courriel ou des renseignements qu'il contient par une
personne autre que le ou les destinataires désignés est interdite. Si vous 
recevez
ce courriel par erreur, veuillez le supprimer immédiatement et envoyer sans 
délai à
l'expéditeur un message électronique pour l'aviser que vous avez éliminé de 
votre
ordinateur toute copie du courriel reçu.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] troubles with R CMD check and examples under Ubuntu gutsy

2008-05-04 Thread Patrick Giraudoux

Dear listers,

I was used to package pgirmess under Windows with everything OK, but, 
for the first time, I had a trial this afternoon on Ubuntu 7.10 gutsy (I 
have a double boot computer and work more and more under unix) and R 
2.7.0. Everything went OK except this:


sudo R CMD check pgirmess
.

* checking examples ... ERROR
Running examples in 'pgirmess-Ex.R' failed.
The error most likely occurred in:

> ### * PermTest
>
> flush(stderr()); flush(stdout())
>
> ### Name: PermTest
> ### Title: Permutation test for lm, lme and glm (binomial and Poisson)
> ###   objects
> ### Aliases: PermTest PermTest.lm PermTest.lme PermTest.glm 
print.PermTest

> ### Keywords: htest
>
> ### ** Examples
>
> library(MASS)
> mylm<-lm(Postwt~Prewt,data=anorexia)
> PermTest(mylm,B=250)
Error: could not find function "PermTest"
Execution halted


If I run R CMD check --no-examples pgirmess, everything comes OK. Seems 
again that this check makes problem. I googled a bit on R-devel but did 
not find any understandable post on that...


Any idea about what happens ? (please consider if I can write some lines 
and build a package, I am *not* an advanced fellow in matter of 
packaging... and just know something about running the commands 'R CMD 
check' and R CMD build...)


Thanks in advance,

Patrick

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


Re: [Rd] troubles with R CMD check and examples under Ubuntu gutsy

2008-05-04 Thread Prof Brian Ripley
It seems likely that the contents of 'pgirmess' under Linux are 
incomplete.


There's a recent version of pgirmess on CRAN, and that works under Linux. 
I suggest you try that (start with the tarball, perhaps).


On Mon, 5 May 2008, Patrick Giraudoux wrote:


Dear listers,

I was used to package pgirmess under Windows with everything OK, but, for the 
first time, I had a trial this afternoon on Ubuntu 7.10 gutsy (I have a 
double boot computer and work more and more under unix) and R 2.7.0. 
Everything went OK except this:


sudo R CMD check pgirmess


Do you really want to be doing this under root?  I see no reason to do so 
-- just make sure you have a writeable current directory for your account.



.

* checking examples ... ERROR
Running examples in 'pgirmess-Ex.R' failed.
The error most likely occurred in:


### * PermTest

flush(stderr()); flush(stdout())

### Name: PermTest
### Title: Permutation test for lm, lme and glm (binomial and Poisson)
###   objects
### Aliases: PermTest PermTest.lm PermTest.lme PermTest.glm print.PermTest
### Keywords: htest

### ** Examples

library(MASS)
mylm<-lm(Postwt~Prewt,data=anorexia)
PermTest(mylm,B=250)

Error: could not find function "PermTest"
Execution halted


If I run R CMD check --no-examples pgirmess, everything comes OK. Seems again 
that this check makes problem. I googled a bit on R-devel but did not find 
any understandable post on that...


Any idea about what happens ? (please consider if I can write some lines and 
build a package, I am *not* an advanced fellow in matter of packaging... and 
just know something about running the commands 'R CMD check' and R CMD 
build...)


Thanks in advance,

Patrick




--
Brian D. Ripley,  [EMAIL PROTECTED]
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] error with R-patched (2008-05-02 r45591)

2008-05-04 Thread Mark Kimpel
Thanks guys. For the benefit of anyone following up on this in the future, I
solved my problem in my offending file with:

iconv -f LATIN1 -t UTF-8 methods.output.func.R >> methods.output.func.R

Mark

On Sun, May 4, 2008 at 4:13 AM, Peter Dalgaard <[EMAIL PROTECTED]>
wrote:

> Prof Brian Ripley wrote:
>
> > From the NEWS file for R-patchd:
> > >
> >
> > BUG FIXES
> >
> >oThe parser sometimes accepted invalid quoted strings in a UTF-8
> >locale.
> >
> > This is likely to be the issue, but we still don't have a reproducible
> > example (see the posting guide).
> >
> >  As Brian probably already knows, the issue is likely to be that your
> source file is in a non-UTF-8 encoding. (Emacs has become a little too
> smooth in handling such files almost invisibly. The magic incantation is
>
> C-x RET f utf-8
>
> before saving.)
>
> It can be reproduces as follows:
>
> [EMAIL PROTECTED] ~]$ cat > xxx.R
> "æøå"
> [EMAIL PROTECTED] ~]$ iconv -t latin1 xxx.R > .R
>
> and then R-patched gives
>
> > source("~/.R")
> Error in source("~/.R") :
>  invalid multibyte character in mbcs_get_next at line 1
>
> whereas R-2.6.2 gives
>
> > source(".R")
> > .Last.value
> $value
> [1] "\xe6\xf8\xe5"
>
> $visible
> [1] TRUE
>
>
>
>
>
>
> > On Sat, 3 May 2008, Mark Kimpel wrote:
> >
> >  I have found the cause of the problem I am having with R-patched. In my
> > > .Rprofile I have a function that loads a bunch of my own functions,
> > > one
> > > of which contains the character "(R)". No other version of R I have used
> > > since writing this function ~2 yrs. ago has had a problem reading in
> > > this
> > > character, but apparently R-patched does (invalid multibyte character
> > > in
> > > mbcs_get_next at line 17).
> > >
> >
> > That is a parser error message.
> >
> >  Has something intentional or unintentional
> > > occured to cause this? I suspect unintentional since this would seem
> > > to
> > > be a loss of functionalilty unlikely to be introduced in a patch of a
> > > release.
> > >
> > > Anyway, that's the issue, R-patched doesn't like "(R)".
> > >
> >
> > I get
> >
> >  "(R)"
> > >
> > [1] "(R)"
> >
> > in R-patched in UTF-8.
> >
> >
> > > Mark
> > >
> > >
> > > On Sat, May 3, 2008 at 4:20 PM, Prof Brian Ripley <
> > > [EMAIL PROTECTED]>
> > > wrote:
> > >  On Sat, 3 May 2008, Mark Kimpel wrote:
> > >
> > >Just installed the latest R-patched and get the
> > >error seen at the end of the
> > >output below. Don't know what to make of this but
> > >thought I should report
> > >it.
> > >
> > >
> > > Nor do we.  You have something incorrect in your startup files, but
> > > we don't have those.
> > >
> > >  In general, when installing the latest version of R,
> > >  should one use
> > >  R-latest or R-patched? R-latest is stable, but one
> > >  would assume that
> > >  R-patched includes the latest bug fixes.
> > >
> > >
> > > And you terminolgy is from where?  (Not e.g. the R FAQ.)
> > >
> > > Mark
> > >
> > > mkimpel-m90 ~/R_HOME/R-patched/R-build/bin: ./R
> > >
> > > R version 2.7.0 Patched (2008-05-02 r45591)
> > > Copyright (C) 2008 The R Foundation for Statistical Computing
> > > ISBN 3-900051-07-0
> > >
> > > R is free software and comes with ABSOLUTELY NO WARRANTY.
> > > You are welcome to redistribute it under certain conditions.
> > > Type 'license()' or 'licence()' for distribution details.
> > >
> > >  Natural language support but running in an English locale
> > >
> > > R is a collaborative project with many contributors.
> > > Type 'contributors()' for more information and
> > > 'citation()' on how to cite R or R packages in publications.
> > >
> > > Type 'demo()' for some demos, 'help()' for on-line help, or
> > > 'help.start()' for an HTML browser interface to help.
> > > Type 'q()' to quit R.
> > >
> > > Loading required package: utils
> > > [1] "packages do not need updated"
> > > Error in source(source.files[i]) :
> > >  invalid multibyte character in mbcs_get_next at line 17
> > > [Previously saved workspace restored]
> > >
> > >  sessionInfo()
> > >
> > > R version 2.7.0 Patched (2008-05-02 r45591)
> > > x86_64-unknown-linux-gnu
> > >
> > > locale:
> > > LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_
> > >
> > > MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;L
> > >
> > > C_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C
> > >
> > > attached base packages:
> > > [1] stats graphics  grDevices datasets  utils methods
> > >  base
> > >
> > >
> > > --
> > > Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry
> > > Indiana University School of Medicine
> > >
> > > 15032 Hunter Court, Westfield, IN 46074
> > >
> > > (317) 490-5129 Work, & Mobile & VoiceMail
> > > (317) 663-0513 Home (no voice mail please)
> > >
> > > **
> > >
> > >   [[a

Re: [Rd] error with R-patched (2008-05-02 r45591)

2008-05-04 Thread Peter Dalgaard

Mark Kimpel wrote:

Thanks guys. For the benefit of anyone following up on this in the future, I
solved my problem in my offending file with:

iconv -f LATIN1 -t UTF-8 methods.output.func.R >> methods.output.func.R

Mark
  

That line triggers a knee-jerk reflex with me (possibly unfairly since 
it apparently did the job). I have always learned that using the same 
file for input and output is asking for trouble: if something goes wrong 
on the way, you end with neither of them. I'd do


iconv -f LATIN1 -t UTF-8 methods.output.func.R > 
mv  methods.output.func.R



--
  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
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

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


Re: [Rd] error with R-patched (2008-05-02 r45591)

2008-05-04 Thread Mark Kimpel
You're correct, bad form on my part. In reality, I did it in two steps as
you suggested, just condensed for purposes of a brief communication. mark

On Mon, May 5, 2008 at 1:52 AM, Peter Dalgaard <[EMAIL PROTECTED]>
wrote:

> Mark Kimpel wrote:
>
> > Thanks guys. For the benefit of anyone following up on this in the
> > future, I
> > solved my problem in my offending file with:
> >
> > iconv -f LATIN1 -t UTF-8 methods.output.func.R >> methods.output.func.R
> >
> > Mark
> >
> >
> That line triggers a knee-jerk reflex with me (possibly unfairly since it
> apparently did the job). I have always learned that using the same file for
> input and output is asking for trouble: if something goes wrong on the way,
> you end with neither of them. I'd do
>
> iconv -f LATIN1 -t UTF-8 methods.output.func.R > 
> mv  methods.output.func.R
>
>
>
>
> --
>  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
> ~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907
>
>
>


-- 
Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry
Indiana University School of Medicine

15032 Hunter Court, Westfield, IN 46074

(317) 490-5129 Work, & Mobile & VoiceMail
(317) 663-0513 Home (no voice mail please)

**

[[alternative HTML version deleted]]

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


Re: [Rd] troubles with R CMD check and examples under Ubuntu gutsy

2008-05-04 Thread Patrick Giraudoux

Prof Brian Ripley a écrit :
It seems likely that the contents of 'pgirmess' under Linux are 
incomplete.


There's a recent version of pgirmess on CRAN, and that works under 
Linux. I suggest you try that (start with the tarball, perhaps).
Sorry prof Ripley, but this is the same version as the one on CRAN (I am 
the developper)... Actually Kurt Hornik tried it and it went through 
with his debian yesterday (after some troubles -solved- about encoding 
and the new R 6.7.0), Uwe Ligges sent me an automated  message telling 
that it has also been built under Windows successfully (as it was under 
my own Windows version). I have also checked that PermTest was in the 
package. So I suppose that it has something to do with Ubuntu... but 
don't know how to debug this...


On Mon, 5 May 2008, Patrick Giraudoux wrote:



Dear listers,

I was used to package pgirmess under Windows with everything OK, but, 
for the first time, I had a trial this afternoon on Ubuntu 7.10 gutsy 
(I have a double boot computer and work more and more under unix) and 
R 2.7.0. Everything went OK except this:


sudo R CMD check pgirmess


Do you really want to be doing this under root?  I see no reason to do 
so -- just make sure you have a writeable current directory for your 
account.



.

* checking examples ... ERROR
Running examples in 'pgirmess-Ex.R' failed.
The error most likely occurred in:


### * PermTest

flush(stderr()); flush(stdout())

### Name: PermTest
### Title: Permutation test for lm, lme and glm (binomial and Poisson)
###   objects
### Aliases: PermTest PermTest.lm PermTest.lme PermTest.glm 
print.PermTest

### Keywords: htest

### ** Examples

library(MASS)
mylm<-lm(Postwt~Prewt,data=anorexia)
PermTest(mylm,B=250)

Error: could not find function "PermTest"
Execution halted


If I run R CMD check --no-examples pgirmess, everything comes OK. 
Seems again that this check makes problem. I googled a bit on R-devel 
but did not find any understandable post on that...


Any idea about what happens ? (please consider if I can write some 
lines and build a package, I am *not* an advanced fellow in matter of 
packaging... and just know something about running the commands 'R 
CMD check' and R CMD build...)


Thanks in advance,

Patrick






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


Re: [Rd] troubles with R CMD check and examples under Ubuntu gutsy

2008-05-04 Thread Patrick Giraudoux

Berwin A Turlach a écrit :

G'day Patrick

On Mon, 05 May 2008 07:02:23 +0200
Patrick Giraudoux <[EMAIL PROTECTED]> wrote:

  
I was used to package pgirmess under Windows with everything OK, but, 
for the first time, I had a trial this afternoon on Ubuntu 7.10 gutsy

(I have a double boot computer and work more and more under unix) and
R 2.7.0. 



FWIW, on my Ubuntu 8.04 heron machine, with pgirmess_1.3.6.tar.gz from
CRAN, I can run `R CMD check pgirmess_1.3.6.tar.gz' without problems.

Are you talking about that version, or a current development version?

But I have compiled R on my boxes myself.  How did you install R?  From
source or by using the prepackaged Ubuntu deb files?
  
From the pre-packaged Ubuntu, updated to 6.7.0 recently ? Do you think 
it may come from this ?



sudo R CMD check pgirmess



Why do you run this command as root?  I would avoid something like
this.  Is the directory in which pgirmess is in not writeable for your
usual user-id?  Perhaps the problem is that the root account is not
correctly set up to use R (but I would find that hard to believe).

  
No, sorry it was just my mistake. After the failure as standard user, I 
was wondering if packaging should be done as super-user... but things 
come similar.


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


Re: [Rd] troubles with R CMD check and examples under Ubuntu gutsy

2008-05-04 Thread Prof Brian Ripley

On Mon, 5 May 2008, Patrick Giraudoux wrote:


Prof Brian Ripley a écrit :

It seems likely that the contents of 'pgirmess' under Linux are incomplete.

There's a recent version of pgirmess on CRAN, and that works under Linux. I 
suggest you try that (start with the tarball, perhaps).
Sorry prof Ripley, but this is the same version as the one on CRAN (I am the 
developper)... Actually Kurt Hornik tried it and it went through with his 
debian yesterday (after some troubles -solved- about encoding and the new R


Yes, I do know (I solved them).

6.7.0), Uwe Ligges sent me an automated  message telling that it has also 
been built under Windows successfully (as it was under my own Windows 
version). I have also checked that PermTest was in the package. So I suppose 
that it has something to do with Ubuntu... but don't know how to debug 
this...


I suggest you do as I suggest, for the most likely explanation is that 
this is not the same set of files.



On Mon, 5 May 2008, Patrick Giraudoux wrote:



Dear listers,

I was used to package pgirmess under Windows with everything OK, but, for 
the first time, I had a trial this afternoon on Ubuntu 7.10 gutsy (I have 
a double boot computer and work more and more under unix) and R 2.7.0. 
Everything went OK except this:


sudo R CMD check pgirmess


Do you really want to be doing this under root?  I see no reason to do so 
-- just make sure you have a writeable current directory for your account.



.

* checking examples ... ERROR
Running examples in 'pgirmess-Ex.R' failed.
The error most likely occurred in:


### * PermTest

flush(stderr()); flush(stdout())

### Name: PermTest
### Title: Permutation test for lm, lme and glm (binomial and Poisson)
###   objects
### Aliases: PermTest PermTest.lm PermTest.lme PermTest.glm 
print.PermTest

### Keywords: htest

### ** Examples

library(MASS)
mylm<-lm(Postwt~Prewt,data=anorexia)
PermTest(mylm,B=250)

Error: could not find function "PermTest"
Execution halted


If I run R CMD check --no-examples pgirmess, everything comes OK. Seems 
again that this check makes problem. I googled a bit on R-devel but did 
not find any understandable post on that...


Any idea about what happens ? (please consider if I can write some lines 
and build a package, I am *not* an advanced fellow in matter of 
packaging... and just know something about running the commands 'R CMD 
check' and R CMD build...)


Thanks in advance,

Patrick









--
Brian D. Ripley,  [EMAIL PROTECTED]
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] troubles with R CMD check and examples under Ubuntu gutsy

2008-05-04 Thread Patrick Giraudoux

Berwin A Turlach a écrit :

G'day Patrick,

On Mon, 05 May 2008 08:15:29 +0200
Patrick Giraudoux <[EMAIL PROTECTED]> wrote:

  

Berwin A Turlach a écrit :



  

But I have compiled R on my boxes myself.  How did you install R?
>From source or by using the prepackaged Ubuntu deb files?
  
  

 From the pre-packaged Ubuntu, updated to 6.7.0 recently ? Do you
think it may come from this ?



Could be possible, but I would find it hard to believe.  But it raises
the question which pre-packaged packages have you all installed.  Your
package pgirmess seems to have quite a few dependencies (which I had
to install first on my machine before I could run R CMD check).  But
that could be a red herring too, since the problem seems to be that the
command PermTest is not found while the code in the examples are run.
  
There has been a threat on something similar in R-devel on August 
2007...  but I cannot understand the meaning.
Did you look at the file in pgirmess.Rcheck that I mentioned?  
You'll find a copy of pgirmess-Ex.R, but I cannot get what is the 
meaning of this file...

Also,
did you try to load the version of the library in pgrimess.Rcheck in a
R session and check if you find the PermTest function in that case?
  
Yes indeed. I found PermTest in the R folder and in the R-ex folder of 
the pgirmess folder in the pgirmess.Rcheck folder.
 
With these problems, I am a bit of a trial-and-error person, so if I

cannot reproduce the error, I cannot find out what the problem is

Cheers,

Berwin


  

Thanks anyway for the hints. It may help.
  






### * 
###
attach(NULL, name = "CheckExEnv")
assign("nameEx",
  local({
  s <- "__{must remake R-ex/*.R}__"
  function(new) {
  if(!missing(new)) s <<- new else s
  }
  }),
  pos = "CheckExEnv")
## Add some hooks to label plot pages for base and grid graphics
assign("base_plot_hook",
  function() {
  pp <- par(c("mfg","mfcol","oma","mar"))
  if(all(pp$mfg[1:2] == c(1, pp$mfcol[2]))) {
  outer <- (oma4 <- pp$oma[4]) > 0; mar4 <- pp$mar[4]
  mtext(sprintf("help(\"%s\")", nameEx()), side = 4,
line = if(outer)max(1, oma4 - 1) else min(1, mar4 - 1),
  outer = outer, adj = 1, cex = .8, col = "orchid", las=3)
  }
  },
  pos = "CheckExEnv")
assign("grid_plot_hook",
  function() {
  grid::pushViewport(grid::viewport(width=grid::unit(1, "npc") -
 grid::unit(1, "lines"), x=0, just="left"))
  grid::grid.text(sprintf("help(\"%s\")", nameEx()),
  x=grid::unit(1, "npc") + grid::unit(0.5, 
"lines"),

  y=grid::unit(0.8, "npc"), rot=90,
  gp=grid::gpar(col="orchid"))
  },
  pos = "CheckExEnv")
setHook("plot.new", get("base_plot_hook", pos = "CheckExEnv"))
setHook("persp",get("base_plot_hook", pos = "CheckExEnv"))
setHook("grid.newpage", get("grid_plot_hook", pos = "CheckExEnv"))
assign("cleanEx",
  function(env = .GlobalEnv) {
  rm(list = ls(envir = env, all.names = TRUE), envir = env)
  RNGkind("default", "default")
  set.seed(1)
 options(warn = 1)
  .CheckExEnv <- as.environment("CheckExEnv")
  delayedAssign("T", stop("T used instead of TRUE"),
 assign.env = .CheckExEnv)
  delayedAssign("F", stop("F used instead of FALSE"),
 assign.env = .CheckExEnv)
  sch <- search()
  newitems <- sch[! sch %in% .oldSearch]
  for(item in rev(newitems))
  eval(substitute(detach(item), list(item=item)))
  missitems <- .oldSearch[! .oldSearch %in% sch]
  if(length(missitems))
  warning("items ", paste(missitems, collapse=", "),
  " have been removed from the search path")
  },
  pos = "CheckExEnv")
assign("ptime", proc.time(), pos = "CheckExEnv")
## at least one package changes these via ps.options(), so do this
## before loading the package.
## Use postscript as incomplete files may be viewable, unlike PDF.
## Choose a size that is close to on-screen devices, fix paper
ps.options(width = 7, height = 7, paper = "a4", reset = TRUE)
grDevices::postscript("pgirmess-Ex.ps")

assign("par.postscript", graphics::par(no.readonly = TRUE), pos = 
"CheckExEnv")
options(contrasts = c(unordered = "contr.treatment", ordered = 
"contr.poly"))
options(warn = 1)   
library('pgirmess')


assign(".oldSearch", search(), pos = 'CheckExEnv')
assign(".oldNS", loadedNamespaces(), pos = 'CheckExEnv')
cleanEx(); nameEx("PermTest")
### * PermTest

flush(stderr()); flush(stdout())

### Name: PermTest
### Title: Permutation test for lm, lme and glm (binomial and Poisson)
###   objects
### Aliases: PermTest PermTest.lm PermTest.lme PermTest.glm print.PermTest
### Keywords: htest

### ** Examples

library(MASS)
mylm<-lm(Postwt~Prewt,data=anorexia)
PermTest(mylm,B=250)

## Dobson (1990) Page 93: Random