Re: [Rd] S4: what to put in initialize, validity and constructor?

2008-05-03 Thread Oleg Sklyar



[EMAIL PROTECTED] wrote:



Do not change initialize!


As I sat, this is a toy example. In my real example, initialize does a 
lot of things like calculation of quality indice (b is not the scare of 
a, but B1, B2 and B3 are the the within matrix of A after imputation 
with 3 differents methods), giving names to some matrix column and so 
on. So I seams costfull to not use an initialize.


This all can be done in one of the constructors, which is then called by 
the other, as in my example below. I do not see a contradiction.






Define constructors:

setGeneric("A", function(a,b,...) standardGeneric("A"))

setMethod("A", signature(a="missing",b="missing"),
 function(a,b,...) A(as.numeric(1:10),...) ## calls the one below
)

setMethod("A", signature(a="A",b="missing"),
 function(a,b,...) a
)

setMethod("A", signature(a="ANY",b="ANY"),
 function(a,b,...) new("A",a=as.numeric(a),b=as.numeric(b),...)
)

setMethod("A", signature(a="ANY",b="missing"),
 function(a,b,...) A(a,a,...) ## Calls the one above
)

etc.

In words:
1) validity should return a character in case of errors
2) default initializer usually does the job
3) define constructors as methods to allow different signatures and
  conversions from other classes
4) If you derive your class from numeric, rather than add slots,
  the performance will be much better and you will get default
  behaviour of numeric, i.e.

setClass("A",
 representatiom("numeric", b="numeric") etc

Dr Oleg Sklyar
Technology Group
Man Investments Ltd
+44 (0)20 7144 3803
[EMAIL PROTECTED]


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: 02 May 2008 15:41
To: r-devel@r-project.org
Subject: [Rd] S4: what to put in initialize, validity and constructor?

Hi the list,

I have some trouble using validity, intialize and the
constructor. More precisely, what should go where?
Here is a toy exemple (seams long, but the code is very simple):

I want to define an object with two slots a and b with the
properties that b will be either empty or the scare of a.
Example of valid object :
  a=  b=
  a=2 b=
  a=3 b=9

So I define my object and the validity function :

setClass(
"A",
representation(a="numeric",b="numeric"),
validity=function(object){
cat("Validity\n")
if(length([EMAIL PROTECTED])!=0){
if(length([EMAIL PROTECTED])==0){stop("Can not have empty
a and non emty b")}else{}
if([EMAIL PROTECTED]@b){stop("b is not the scare
of a")}else{}
}else{}
return(TRUE)
}
)

It works:

new("A")
new("A",a=2,b=4)
try(new("A",b=4))
new("A",a=2)
try(new("A",a=2,b=3))


Then I define the initialize function. When b is givent but
not a, the initialise function set a to sqrt(b).

setMethod(
"initialize",
"A",
function(.Object,a,b){
if(missing(a)&!missing(b)){
[EMAIL PROTECTED] <- b
[EMAIL PROTECTED] <- sqrt(b)
}else{}
if(!missing(a)&missing(b)){
[EMAIL PROTECTED] <- a
}else{}
if(!missing(a)&!missing(b)){
[EMAIL PROTECTED] <- a
[EMAIL PROTECTED] <- b
}else{}
validObject(.Object)
return(.Object)
}
)

It is fine:

new("A")
new("A",a=2,b=4)
new("A",b=9)
new("A",a=2)
try(new("A",a=2,b=3))


Then I want to set the constructor

A <- function(a,b){
return(new("A",a,b))
}

But this does not work:
A()
A(a=2,b=4)
A(b=9)
A(a=2)


The following does not work either:

A <- function(a=numeric(),b=numeric()){
return(new("A",a,b))
}

A()
A(a=2,b=4)
A(b=9)
A(a=2)

So is there a way to define the constructor A without dealing
again with all the missing&missing staff like in initialize?

Christophe

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




**
The contents of this email are for the named addressee(s) only.
It contains information which may be confidential and privileged.
If you are not the intended recipient, please notify the sender
immediately, destroy this email and any attachments and do not
otherwise disclose or use them. Email transmission is not a
secure method of communication and Man Investments cannot accept
responsibility for the completeness or accuracy of this email or
any attachments. Whilst Man Investments makes every effort to keep
its network free from viruses, it does not accept responsibility
for any computer virus which might be transferred by way of this
email or any attachments. This email does not constitute a request,
offer, recommendation or solicitation of any kind to buy, subscribe,
sell or redeem any investment instruments or to perform other such
transactions of any kind. Man Investments reserves the right to
monitor, record and retain all electronic communications through
its network to ensure the integrity of its systems, for record
keeping and regulatory purp

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

2008-05-03 Thread m . crawley
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.
=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.901e+00  5.251e-01-5.526 7.44e-06 ***
antibiobcock  5.035e-01  6.737e-01 0.7470.461=20=20=20=
=20
antibiocamp  -4.058e-18  7.426e-01 -5.47e-181.000=20=20=20=
=20
toxinCry1Ab   2.818e+00  5.747e-01 4.904 3.94e-05 ***
toxinVip3A3.840e+00  5.857e-01 6.556 4.96e-07 ***
antibiobcock:toxinCry1Ab  4.134e+00  1.352e+00 3.0570.005 **=20
antibiocamp:toxinCry1Ab  -4.721e-01  8.153e-01-0.5790.567=20=20=20=
=20
anti

[Rd] Using option na.rm=True in function SD does not work for matrix with complete columns of NAs (PR#11364)

2008-05-03 Thread m . tschiedel
Dear R-developers,
=20
according to the "what's new"-section in version R 2.7.0, there has been =
a change in the working of co[rv] and so also in sd and var.
=20
I am afraid, that the use of function sd with option "na.rm=3DT" has not =
been changed appropriately. So the following problem exists with missing =
data:
=20
> sessionInfo()
R version 2.7.0 (2008-04-22)=20
i386-pc-mingw32=20
=20
locale:
LC_COLLATE=3DGerman_Austria.1252;LC_CTYPE=3DGerman_Austria.1252;LC_MONETA=
RY=3DGerman_Austria.1252;LC_NUMERIC=3DC;LC_TIME=3DGerman_Austria.1252
=20
attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base  =20
=20
=20
a<-matrix(rnorm(100),10,10); a[1,]<-NA

> sd(a,na.rm=3DT)
Fehler in var(x, na.rm =3D na.rm) : keine vollst=E4ndigen Elementpaare

this error is clear as "sd" is using "var" and in case of na.rm=3DT =
"var" uses "na.method=3Dcomplete.obs" which is obviously never the case =
in this example.
=20
So I suggest to set the default.method for na.rm=3DT to =
"pairwise.complete.obs" to get the same result as in previous versions =
of R, that is the same as=20

> sqrt(diag(var(a,use=3D"pair")))
 [1]NA 0.9117738 0.5953496 0.9272141 0.8864333 0.8045383 =
0.4240055 1.0304519 0.9221493 1.2087638

Best regards,
=20
Martin

--=20
Martin Tschiedel
Senior Investment ManagerA Siemens Company=09

INNOVEST Kapitalanlage AG
Email: [EMAIL PROTECTED]

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


[Rd] Quartz doesn't display x-axis properly until a window resize (PR#11368)

2008-05-03 Thread luis . lopezoliveros
Full_Name: Luis Lopez-Oliveros
Version: 2.7.0
OS: Mac OS X 10.5.2
Submission from: (NULL) (71.176.115.32)


In R 2.7.0 for Mac OS X, Quartz plots are drawn a little bit off-screen. What
happens is that
the plots appear to be displayed a little below than where they should be in the
Quartz window,
causing the x-axis to be drawn off-screen, "below" the bottom of the Quartz
window.
When resizing the window, the Quartz windows' size and the particular plots'
size are matched
and only after doing that you can see the entire graphics properly.

In http://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html#Sparse-questions,
point 12.8, it is explained that Quartz plots are much bigger now because
"all devices in R have a default size of 7 inches. Quartz used a default of 5
inches and that was now changed to match all other devices." However, the above
bug shows this hasn't been corrected.

I attach the sessionInfo() output below.

> sessionInfo()
R version 2.7.0 (2008-04-22) 
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

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


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

2008-05-03 Thread Charles C. Berry



NOT a bug.

The estimate of the probability of mi is precisely 1.0 for one cell in 
your setup.


The information contributed by that cell has a factor of 
p*(1-p) in it, which works out to zero.


The bad behavior of asymptotic methods for binary regressions in such 
settings is well known.


HTH,

Chuck

On Thu, 1 May 2008, [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.
=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.901e+00  5.251e-01-5.526 7.44e-06 ***
antibiobcock  5.035e-01  6.737e-01 0.7470.461=20=20=20=
=20
antibiocamp 

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

2008-05-03 Thread Mark Kimpel
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. 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.
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;LC_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


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

2008-05-03 Thread Prof Brian Ripley

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;LC_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

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


[Rd] texi2dvi instead of pdflatex in R2.7.0? and related bioc 2.2 builds

2008-05-03 Thread Oleg Sklyar

Dear lists:

I am somewhat puzzled by the use of texi2dvi/pdflatex in R2.7.0. When 
building EBImage (bioconductor) with 2.7.0 I get the same error both in 
Windows and Linux, which reads the following:


** building package indices ...
* DONE (EBImage)
* creating vignettes ... ERROR
/usr/bin/texi2dvi: pdflatex exited with bad status, quitting.
Error in texi2dvi(file = bft, pdf = TRUE, clean = FALSE, quiet = quiet) :
  running 'texi2dvi' on 'AnalysisWithEBImage.tex' failed
Calls: buildVignettes -> texi2dvi
Execution halted


The tex file includes links to png graphics and this might be the 
reason. Running pdflatex on the generated tex file directly produces a 
nice pdf in both Linux and Windows. And this seems have been the default 
in previous version of R.


Now the puzzles are:

1) the bioc build system also uses 2.7.0 and builds vignettes just fine 
on both Windows and Linux:


* DONE (EBImage)
* creating vignettes ... OK
* removing junk files
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* building 'EBImage_2.4.0.tar.gz'

2) have the tex settings been changed from 2.6.0 into 2.7.0 as changes 
to vignette have not been significant and the compilation goes through 
fine with 2.6.0.


Or I am missing something and doing something wrong?

Best,
Oleg

--
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


[Rd] R CMD check: small tests suggestion

2008-05-03 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.

Hadley

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

__
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-03 Thread Mark Kimpel
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). 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)".

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;LC_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)

**

[[alternative HTML version deleted]]

__
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-03 Thread Prof Brian Ripley

On Sat, 3 May 2008, hadley wickham wrote:


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.


--
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-03 Thread Prof Brian Ripley

From the NEWS file for R-patchd:


BUG FIXES

o   The 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).



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, UK                Fax:  +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)

**



--
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