Re: [Rd] fortran 90 underscore error

2011-03-15 Thread Prof Brian Ripley
We have no position about Fortran 90.  We provide the means to specify 
an F90 compiler and note that its use is not portable as not all 
platforms have one.  (A very few are still using gcc3 with g77.)


This simply is not an R issue, and seems specific to your unstated 
platform (*PLEASE* do follow the posting guide).


On Mon, 14 Mar 2011, jgar...@ija.csic.es wrote:


Hi there,

I am preparing a package based on Fortran 90 code. I've put the main code
is a MODULE, and I'm having several error messages with the linker:


R CMD SHLIB --output=mylib.so nrtype.f90 topbalmod.f90 runmodels.f90


The several error messages are related with the addition of an underscore
to function names (no problem with subroutine names). E.g.:

topbalmod.o:topbalmod.f90:.text+0x357f: undefined reference to 'runga_'

After some googling, AFAIK, it seems the addition of underscores (I'm
using gfortran) may be avoided by the option -fno-underscoring, but its
use is not recomended as it is not of general use by all compilers.

I'm just wondering if R developers just recommend not to use user defined
fortran functions at all to avoid this problem, or alternatively if you
could provided with some example about how to circumvent it (perhaps to
convert all fortran 90 functions into subroutines?).

Thanks and best regards.

Javier
---


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

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


[Rd] Feature request: txtProgressBar with ability to write to arbitrary stream

2011-03-15 Thread Andreas Borg

Hi all,

I use txtProgressBar to monitor progress of large computations. What I 
miss is the ability to redirect the progress bar to a stream other than 
stdout, specifically to the message stream. This would be useful for 
running Sweave scripts: When redirected to stderr, the bar could be 
visible even though console output is diverted to the output file (and 
there would be no cluttering of the generated latex).


I'd suggest the following changes to txtProgressBar:
- a new argument 'file' (compare to 'cat') which defaults to stderr() 
(there might be reasons to use stdout(), but I believe a progress bar is 
mostly intended as a diagnostic tool and not for console output, which 
is printed or saved in some cases).
- the calls to 'cat' that update the progress bar get 'file = file' as 
additional argument so that output is redirected as desired.


In case anyone from the core team is willing to incorparate this idea, I 
attached the patch file for the necessary changes below.


Best regards,

Andreas

3c3
  width = NA, title, label, style = 1)
---
  width = NA, title, label, style = 1, file=stderr())
23c23
 cat(paste(rep.int(char, nb-.nb), collapse=))
---
 cat(paste(rep.int(char, nb-.nb), collapse=), file = file)
27c27
 \r, paste(rep.int(char, nb), collapse=), sep = )
---
 \r, paste(rep.int(char, nb), collapse=), sep = 
, file = file)

38c38
 cat(\r, paste(rep.int(char, nb), collapse=), sep = )
---
 cat(\r, paste(rep.int(char, nb), collapse=), sep = 
, file = file)

42c42
 \r, paste(rep.int(char, nb), collapse=), sep = )
---
 \r, paste(rep.int(char, nb), collapse=), sep = 
, file = file)

54c54
 cat(paste(c(\r  |, rep.int( , nw*width+6)), collapse=))
---
 cat(paste(c(\r  |, rep.int( , nw*width+6)), collapse=), 
file = file)

59c59
 ), collapse=))
---
 ), collapse=), file = file)
68c68
 cat(\n)
---
 cat(\n, file = file)

--
Andreas Borg
Medizinische Informatik

UNIVERSITÄTSMEDIZIN
der Johannes Gutenberg-Universität
Institut für Medizinische Biometrie, Epidemiologie und Informatik
Obere Zahlbacher Straße 69, 55131 Mainz
www.imbei.uni-mainz.de

Telefon +49 (0) 6131 175062
E-Mail: b...@imbei.uni-mainz.de

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. 
Wenn Sie nicht der
richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren 
Sie bitte sofort den
Absender und löschen Sie diese Mail. Das unerlaubte Kopieren sowie die 
unbefugte Weitergabe
dieser Mail und der darin enthaltenen Informationen ist nicht gestattet.

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


Re: [Rd] Standardized Pearson residuals

2011-03-15 Thread John Maindonald
 Peter Dalgaard: It would also be nice for teaching purposes if glm or 
 summary.glm had a
 pearsonchisq component and a corresponding extractor function, but I
 can imagine that there might be arguments against it that haven't
 occured to me.  Plus, I doubt that anyone wants to touch glm unless it's
 to repair a bug. If I'm wrong about all that though, ...

This would remedy what I have long judged a deficiency in summary.glm().
The information is important for diagnostic purposes.  One should not have
to fit a model with a quasi error, or suss out how to calculate the Pearson
chi square from the glm model object, to discover that the information in the
model object is inconsistent with simple binomial or poisson assumptions.

John Maindonald email: john.maindon...@anu.edu.au
phone : +61 2 (6125)3473fax  : +61 2(6125)5549
Centre for Mathematics  Its Applications, Room 1194,
John Dedman Mathematical Sciences Building (Building 27)
Australian National University, Canberra ACT 0200.
http://www.maths.anu.edu.au/~johnm

On 15/03/2011, at 10:00 PM, r-devel-requ...@r-project.org wrote:

 From: Brett Presnell presn...@stat.ufl.edu
 Date: 15 March 2011 2:40:29 PM AEDT
 To: peter dalgaard pda...@gmail.com
 Cc: r-devel@r-project.org
 Subject: Re: [Rd] Standardized Pearson residuals
 
 
 
 Thanks Peter.  I have just a couple of minor comments, and another
 possible feature request, although it's one that I don't think will be
 implemented.
 
 peter dalgaard pda...@gmail.com writes:
 
 On Mar 14, 2011, at 22:25 , Brett Presnell wrote:
 
 
 Is there any reason that rstandard.glm doesn't have a pearson option?
 And if not, can it be added?
 
 Probably... I have been wondering about that too. I'm even puzzled why
 it isn't the default. Deviance residuals don't have quite the
 properties that one might expect, e.g. in this situation, the absolute
 residuals sum pairwise to zero, so you'd expect that the standardized
 residuals be identical in absolute value
 
 y - 1:4
 r - c(0,0,1,1)
 c - c(0,1,0,1)
 rstandard(glm(y~r+c,poisson))
 1  2  3  4 
 -0.2901432  0.2767287  0.2784603 -0.2839995 
 
 in comparison,
 
 i - influence(glm(y~r+c,poisson))
 i$pear.res/sqrt(1-i$hat)
 1  2  3  4 
 -0.2817181  0.2817181  0.2817181 -0.2817181 
 
 The only thing is that I'm always wary of tampering with this stuff,
 for fear of finding out the hard way why thing are the way they
 are
 
 I'm sure that's wise, but it would be nice to get it in as an option,
 even if it's not the default
 
 Background: I'm currently teaching an undergrad/grad-service course from
 Agresti's Introduction to Categorical Data Analysis (2nd edn) and
 deviance residuals are not used in the text.  For now I'll just provide
 the students with a simple function to use, but I prefer to use R's
 native capabilities whenever possible.
 
 Incidentally, chisq.test will have a stdres component in 2.13.0 for
 much the same reason.
 
 Thank you.  That's one more thing I won't have to provide code for
 anymore.  Coincidentally, Agresti mentioned this to me a week or two ago
 as something that he felt was missing, so that's at least two people who
 will be happy to see this added.
 
 It would also be nice for teaching purposes if glm or summary.glm had a
 pearsonchisq component and a corresponding extractor function, but I
 can imagine that there might be arguments against it that haven't
 occured to me.  Plus, I doubt that anyone wants to touch glm unless it's
 to repair a bug. If I'm wrong about all that though, ...
 
 BTW, as I go along I'm trying to collect a lot of the datasets from the
 examples and exercises in the text into an R package (icda).  It's far
 from complete and what is there needed tidying up, but I hope to
 eventually to round it into shape and put it on CRAN, assuming that
 Agresti approves and that there are no copyright issues.
 
 I think something along the following lines should do it:
 
 rstandard.glm -
 function(model,
  infl=influence(model, do.coef=FALSE),
  type=c(deviance, pearson), ...)
 {
 type - match.arg(type)
 res - switch(type, pearson = infl$pear.res, infl$dev.res)
 res - res/sqrt(1-infl$hat)
 res[is.infinite(res)] - NaN
 res
 }
 


[[alternative HTML version deleted]]

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


Re: [Rd] Standardized Pearson residuals

2011-03-15 Thread Jari Oksanen
On 15/03/11 13:17 PM, peter dalgaard pda...@gmail.com wrote:

 
 On Mar 15, 2011, at 04:40 , Brett Presnell wrote:
 
 
 Background: I'm currently teaching an undergrad/grad-service course from
 Agresti's Introduction to Categorical Data Analysis (2nd edn) and
 deviance residuals are not used in the text.  For now I'll just provide
 the students with a simple function to use, but I prefer to use R's
 native capabilities whenever possible.
 
 Incidentally, chisq.test will have a stdres component in 2.13.0 for
 much the same reason.
 
 Thank you.  That's one more thing I won't have to provide code for
 anymore.  Coincidentally, Agresti mentioned this to me a week or two ago
 as something that he felt was missing, so that's at least two people who
 will be happy to see this added.
 
 
 And of course, I was teaching a course based on Agresti  Franklin:
 Statistics, The Art and Science of Learning from Data, when I realized that
 R was missing standardized residuals.
 
So nobody uses McCullagh  Nelder: Generalized Linear Models in teaching,
since they don't realize that R is missing Anscombe residuals, too?

Cheers, Jari Oksanen

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


Re: [Rd] Feature request: txtProgressBar with ability to write to arbitrary stream

2011-03-15 Thread Matt Shotwell
Here's a temporary fix; reassign 'cat' in the environment of 
'txtProgressBar':


tpbEnv - new.env()
assign(cat, function(...) cat(file=stderr(),...), tpbEnv)
environment(txtProgressBar) - tpbEnv

Best,
Matt


On 03/15/2011 05:37 AM, Andreas Borg wrote:

Hi all,

I use txtProgressBar to monitor progress of large computations. What I
miss is the ability to redirect the progress bar to a stream other than
stdout, specifically to the message stream. This would be useful for
running Sweave scripts: When redirected to stderr, the bar could be
visible even though console output is diverted to the output file (and
there would be no cluttering of the generated latex).

I'd suggest the following changes to txtProgressBar:
- a new argument 'file' (compare to 'cat') which defaults to stderr()
(there might be reasons to use stdout(), but I believe a progress bar is
mostly intended as a diagnostic tool and not for console output, which
is printed or saved in some cases).
- the calls to 'cat' that update the progress bar get 'file = file' as
additional argument so that output is redirected as desired.

In case anyone from the core team is willing to incorparate this idea, I
attached the patch file for the necessary changes below.

Best regards,

Andreas

3c3
 width = NA, title, label, style = 1)
---
  width = NA, title, label, style = 1, file=stderr())
23c23
 cat(paste(rep.int(char, nb-.nb), collapse=))
---
  cat(paste(rep.int(char, nb-.nb), collapse=), file = file)
27c27
 \r, paste(rep.int(char, nb), collapse=), sep = )
---
  \r, paste(rep.int(char, nb), collapse=), sep = , file = file)
38c38
 cat(\r, paste(rep.int(char, nb), collapse=), sep = )
---
  cat(\r, paste(rep.int(char, nb), collapse=), sep = , file = file)
42c42
 \r, paste(rep.int(char, nb), collapse=), sep = )
---
  \r, paste(rep.int(char, nb), collapse=), sep = , file = file)
54c54
 cat(paste(c(\r |, rep.int( , nw*width+6)), collapse=))
---
  cat(paste(c(\r |, rep.int( , nw*width+6)), collapse=), file =
file)
59c59
 ), collapse=))
---
  ), collapse=), file = file)
68c68
 cat(\n)
---
  cat(\n, file = file)




--
Matthew S Shotwell   Assistant Professor   School of Medicine
 Department of Biostatistics   Vanderbilt University

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


Re: [Rd] Standardized Pearson residuals

2011-03-15 Thread peter dalgaard

On Mar 15, 2011, at 13:42 , John Maindonald wrote:

 Peter Dalgaard: It would also be nice for teaching purposes if glm or 
 summary.glm had a
 pearsonchisq component and a corresponding extractor function, but I
 can imagine that there might be arguments against it that haven't
 occured to me.  Plus, I doubt that anyone wants to touch glm unless it's
 to repair a bug. If I'm wrong about all that though, ...
 

Umm, that was Brett, actually.

 This would remedy what I have long judged a deficiency in summary.glm().
 The information is important for diagnostic purposes.  One should not have
 to fit a model with a quasi error, or suss out how to calculate the Pearson
 chi square from the glm model object, to discover that the information in the
 model object is inconsistent with simple binomial or poisson assumptions.

It could be somewhere between useless and misleading in cases like binary 
logistic regression though. (Same thing goes for the test against the saturated 
model: Sometimes it makes sense and sometimes not.)

 
 John Maindonald email: john.maindon...@anu.edu.au
 phone : +61 2 (6125)3473fax  : +61 2(6125)5549
 Centre for Mathematics  Its Applications, Room 1194,
 John Dedman Mathematical Sciences Building (Building 27)
 Australian National University, Canberra ACT 0200.
 http://www.maths.anu.edu.au/~johnm
 
 On 15/03/2011, at 10:00 PM, r-devel-requ...@r-project.org wrote:
 
 From: Brett Presnell presn...@stat.ufl.edu
 Date: 15 March 2011 2:40:29 PM AEDT
 To: peter dalgaard pda...@gmail.com
 Cc: r-devel@r-project.org
 Subject: Re: [Rd] Standardized Pearson residuals
 
 
 
 Thanks Peter.  I have just a couple of minor comments, and another
 possible feature request, although it's one that I don't think will be
 implemented.
 
 peter dalgaard pda...@gmail.com writes:
 
 On Mar 14, 2011, at 22:25 , Brett Presnell wrote:
 
 
 Is there any reason that rstandard.glm doesn't have a pearson option?
 And if not, can it be added?
 
 Probably... I have been wondering about that too. I'm even puzzled why
 it isn't the default. Deviance residuals don't have quite the
 properties that one might expect, e.g. in this situation, the absolute
 residuals sum pairwise to zero, so you'd expect that the standardized
 residuals be identical in absolute value
 
 y - 1:4
 r - c(0,0,1,1)
 c - c(0,1,0,1)
 rstandard(glm(y~r+c,poisson))
1  2  3  4 
 -0.2901432  0.2767287  0.2784603 -0.2839995 
 
 in comparison,
 
 i - influence(glm(y~r+c,poisson))
 i$pear.res/sqrt(1-i$hat)
1  2  3  4 
 -0.2817181  0.2817181  0.2817181 -0.2817181 
 
 The only thing is that I'm always wary of tampering with this stuff,
 for fear of finding out the hard way why thing are the way they
 are
 
 I'm sure that's wise, but it would be nice to get it in as an option,
 even if it's not the default
 
 Background: I'm currently teaching an undergrad/grad-service course from
 Agresti's Introduction to Categorical Data Analysis (2nd edn) and
 deviance residuals are not used in the text.  For now I'll just provide
 the students with a simple function to use, but I prefer to use R's
 native capabilities whenever possible.
 
 Incidentally, chisq.test will have a stdres component in 2.13.0 for
 much the same reason.
 
 Thank you.  That's one more thing I won't have to provide code for
 anymore.  Coincidentally, Agresti mentioned this to me a week or two ago
 as something that he felt was missing, so that's at least two people who
 will be happy to see this added.
 
 It would also be nice for teaching purposes if glm or summary.glm had a
 pearsonchisq component and a corresponding extractor function, but I
 can imagine that there might be arguments against it that haven't
 occured to me.  Plus, I doubt that anyone wants to touch glm unless it's
 to repair a bug. If I'm wrong about all that though, ...
 
 BTW, as I go along I'm trying to collect a lot of the datasets from the
 examples and exercises in the text into an R package (icda).  It's far
 from complete and what is there needed tidying up, but I hope to
 eventually to round it into shape and put it on CRAN, assuming that
 Agresti approves and that there are no copyright issues.
 
 I think something along the following lines should do it:
 
 rstandard.glm -
 function(model,
 infl=influence(model, do.coef=FALSE),
 type=c(deviance, pearson), ...)
 {
 type - match.arg(type)
 res - switch(type, pearson = infl$pear.res, infl$dev.res)
 res - res/sqrt(1-infl$hat)
 res[is.infinite(res)] - NaN
 res
 }
 
 
 
   [[alternative HTML version deleted]]
 
 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd@cbs.dk  Priv: pda...@gmail.com

__

Re: [Rd] Standardized Pearson residuals

2011-03-15 Thread peter dalgaard

On Mar 15, 2011, at 14:22 , Jari Oksanen wrote:

 On 15/03/11 13:17 PM, peter dalgaard pda...@gmail.com wrote:
 
 
 On Mar 15, 2011, at 04:40 , Brett Presnell wrote:
 
 
 Background: I'm currently teaching an undergrad/grad-service course from
 Agresti's Introduction to Categorical Data Analysis (2nd edn) and
 deviance residuals are not used in the text.  For now I'll just provide
 the students with a simple function to use, but I prefer to use R's
 native capabilities whenever possible.
 
 Incidentally, chisq.test will have a stdres component in 2.13.0 for
 much the same reason.
 
 Thank you.  That's one more thing I won't have to provide code for
 anymore.  Coincidentally, Agresti mentioned this to me a week or two ago
 as something that he felt was missing, so that's at least two people who
 will be happy to see this added.
 
 
 And of course, I was teaching a course based on Agresti  Franklin:
 Statistics, The Art and Science of Learning from Data, when I realized that
 R was missing standardized residuals.
 
 So nobody uses McCullagh  Nelder: Generalized Linear Models in teaching,
 since they don't realize that R is missing Anscombe residuals, too?
 
 Cheers, Jari Oksanen
 

Well, if you can read the book, you can probably write the code...

The other books are for beginners who may need the convenience (and persuasion 
power) of standard software.

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd@cbs.dk  Priv: pda...@gmail.com

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


Re: [Rd] Feature request: txtProgressBar with ability to write to arbitrary stream

2011-03-15 Thread Duncan Murdoch

On 15/03/2011 8:46 AM, Matt Shotwell wrote:

Here's a temporary fix; reassign 'cat' in the environment of
'txtProgressBar':

tpbEnv- new.env()
assign(cat, function(...) cat(file=stderr(),...), tpbEnv)
environment(txtProgressBar)- tpbEnv


I would suggest renaming the function as well.  What's done above 
creates a new function called txtProgressBar, it doesn't modify the 
original one, so depending on scoping issues it may appear to only work 
sometimes.  But if you did


stderrProgressBar - txtProgressBar
environment(stderrProgressBar) - tpbEnv

you'll get clear messages if it is out of scope when you try to use it.

Duncan Murdoch


Best,
Matt


On 03/15/2011 05:37 AM, Andreas Borg wrote:
  Hi all,

  I use txtProgressBar to monitor progress of large computations. What I
  miss is the ability to redirect the progress bar to a stream other than
  stdout, specifically to the message stream. This would be useful for
  running Sweave scripts: When redirected to stderr, the bar could be
  visible even though console output is diverted to the output file (and
  there would be no cluttering of the generated latex).

  I'd suggest the following changes to txtProgressBar:
  - a new argument 'file' (compare to 'cat') which defaults to stderr()
  (there might be reasons to use stdout(), but I believe a progress bar is
  mostly intended as a diagnostic tool and not for console output, which
  is printed or saved in some cases).
  - the calls to 'cat' that update the progress bar get 'file = file' as
  additional argument so that output is redirected as desired.

  In case anyone from the core team is willing to incorparate this idea, I
  attached the patch file for the necessary changes below.

  Best regards,

  Andreas

  3c3
width = NA, title, label, style = 1)
  ---
 width = NA, title, label, style = 1, file=stderr())
  23c23
cat(paste(rep.int(char, nb-.nb), collapse=))
  ---
 cat(paste(rep.int(char, nb-.nb), collapse=), file = file)
  27c27
\r, paste(rep.int(char, nb), collapse=), sep = )
  ---
 \r, paste(rep.int(char, nb), collapse=), sep = , file = file)
  38c38
cat(\r, paste(rep.int(char, nb), collapse=), sep = )
  ---
 cat(\r, paste(rep.int(char, nb), collapse=), sep = , file = file)
  42c42
\r, paste(rep.int(char, nb), collapse=), sep = )
  ---
 \r, paste(rep.int(char, nb), collapse=), sep = , file = file)
  54c54
cat(paste(c(\r |, rep.int( , nw*width+6)), collapse=))
  ---
 cat(paste(c(\r |, rep.int( , nw*width+6)), collapse=), file =
  file)
  59c59
), collapse=))
  ---
 ), collapse=), file = file)
  68c68
cat(\n)
  ---
 cat(\n, file = file)





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


Re: [Rd] Feature request: txtProgressBar with ability to write to arbitrary stream

2011-03-15 Thread Greg Snow
You could use winProgressBar (windows only) or TkProgressBar (tcltk package 
required) instead, then nothing is output to the console/standard out but you 
still have a visual of your progress.

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111


 -Original Message-
 From: r-devel-boun...@r-project.org [mailto:r-devel-bounces@r-
 project.org] On Behalf Of Andreas Borg
 Sent: Tuesday, March 15, 2011 4:37 AM
 To: R-devel@r-project.org
 Subject: [Rd] Feature request: txtProgressBar with ability to write to
 arbitrary stream
 
 Hi all,
 
 I use txtProgressBar to monitor progress of large computations. What I
 miss is the ability to redirect the progress bar to a stream other than
 stdout, specifically to the message stream. This would be useful for
 running Sweave scripts: When redirected to stderr, the bar could be
 visible even though console output is diverted to the output file (and
 there would be no cluttering of the generated latex).
 
 I'd suggest the following changes to txtProgressBar:
 - a new argument 'file' (compare to 'cat') which defaults to stderr()
 (there might be reasons to use stdout(), but I believe a progress bar
 is
 mostly intended as a diagnostic tool and not for console output, which
 is printed or saved in some cases).
 - the calls to 'cat' that update the progress bar get 'file = file' as
 additional argument so that output is redirected as desired.
 
 In case anyone from the core team is willing to incorparate this idea,
 I
 attached the patch file for the necessary changes below.
 
 Best regards,
 
 Andreas
 
 3c3
   width = NA, title, label, style = 1)
 ---
width = NA, title, label, style = 1, file=stderr())
 23c23
  cat(paste(rep.int(char, nb-.nb), collapse=))
 ---
   cat(paste(rep.int(char, nb-.nb), collapse=), file =
 file)
 27c27
  \r, paste(rep.int(char, nb), collapse=), sep =
 )
 ---
   \r, paste(rep.int(char, nb), collapse=), sep =
 , file = file)
 38c38
  cat(\r, paste(rep.int(char, nb), collapse=), sep =
 )
 ---
   cat(\r, paste(rep.int(char, nb), collapse=), sep =
 , file = file)
 42c42
  \r, paste(rep.int(char, nb), collapse=), sep =
 )
 ---
   \r, paste(rep.int(char, nb), collapse=), sep =
 , file = file)
 54c54
  cat(paste(c(\r  |, rep.int( , nw*width+6)), collapse=))
 ---
   cat(paste(c(\r  |, rep.int( , nw*width+6)),
 collapse=),
 file = file)
 59c59
  ), collapse=))
 ---
   ), collapse=), file = file)
 68c68
  cat(\n)
 ---
   cat(\n, file = file)
 
 --
 Andreas Borg
 Medizinische Informatik
 
 UNIVERSITÄTSMEDIZIN
 der Johannes Gutenberg-Universität
 Institut für Medizinische Biometrie, Epidemiologie und Informatik
 Obere Zahlbacher Straße 69, 55131 Mainz
 www.imbei.uni-mainz.de
 
 Telefon +49 (0) 6131 175062
 E-Mail: b...@imbei.uni-mainz.de
 
 Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
 Informationen. Wenn Sie nicht der
 richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben,
 informieren Sie bitte sofort den
 Absender und löschen Sie diese Mail. Das unerlaubte Kopieren sowie die
 unbefugte Weitergabe
 dieser Mail und der darin enthaltenen Informationen ist nicht
 gestattet.
 
 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel

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


[Rd] object not found whilst loading namespace

2011-03-15 Thread Max Kuhn
I've been updating a package and, when installing a local devel
version, I get an error object 'confusionMatrix' not found whilst
loading namespace. Looking around online, it appears that this might
be related to loading a specific RData file, but it doesn't seem to be
the case AFAICT.

I've installed the devel version in the last week without issues and
the confusionMatrix code has been touched in a while.

Thanks,

Max

 sessionInfo()
R version 2.11.1 (2010-05-31)
x86_64-apple-darwin9.8.0

locale:
[1] 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

other attached packages:
[1] caret_4.71 reshape_0.8.3  plyr_1.2.1 lattice_0.18-8

loaded via a namespace (and not attached):
[1] grid_2.11.1


pkg_kuhna03$ R CMD INSTALL caret
* installing to library ‘/Library/Frameworks/R.framework/Resources/library’
* installing *source* package ‘caret’ ...
** libs
*** arch - i386
gcc -arch i386 -std=gnu99
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/i386
-I/usr/local/include-fPIC  -g -O2 -c caret.c -o caret.o
gcc -arch i386 -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names
-undefined dynamic_lookup -single_module -multiply_defined suppress
-L/usr/local/lib -o caret.so caret.o
-F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework
-Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Resources/library/caret/libs/i386
*** arch - x86_64
gcc -arch x86_64 -std=gnu99
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/x86_64
-I/usr/local/include-fPIC  -g -O2 -c caret.c -o caret.o
gcc -arch x86_64 -std=gnu99 -dynamiclib
-Wl,-headerpad_max_install_names -undefined dynamic_lookup
-single_module -multiply_defined suppress -L/usr/local/lib -o caret.so
caret.o -F/Library/Frameworks/R.framework/.. -framework R
-Wl,-framework -Wl,CoreFoundation
installing to 
/Library/Frameworks/R.framework/Resources/library/caret/libs/x86_64
** R
** data
** inst
** preparing package for lazy loading
Loading required package: plyr

Attaching package: 'reshape'

The following object(s) are masked from 'package:plyr':

round_any

** help
*** installing help indices
** building package indices ...
** testing if installed package can be loaded
Error : object 'confusionMatrix' not found whilst loading namespace 'caret'
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Resources/library/caret’
* restoring previous ‘/Library/Frameworks/R.framework/Resources/library/caret’

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


Re: [Rd] object not found whilst loading namespace

2011-03-15 Thread Max Kuhn
Please disregard the last email...

The issue was a syntactical error in a file that, alphabetically,
comes before confusionMatrix.R in the package.

The odd thing was that the problem in this file did not throw and
error (or I would have easily found it). I decided to source the R
files one by one to see if there were any issues and that showed the
problem:

 source(~/Code/caret/pkg/caret/R/classLevels.R)
Error in source(~/Code/caret/pkg/caret/R/classLevels.R) :
  ~/Code/caret/pkg/caret/R/classLevels.R:150:0: unexpected end of input

Thanks anyway,

Max



On Tue, Mar 15, 2011 at 9:48 PM, Max Kuhn mxk...@gmail.com wrote:
 I've been updating a package and, when installing a local devel
 version, I get an error object 'confusionMatrix' not found whilst
 loading namespace. Looking around online, it appears that this might
 be related to loading a specific RData file, but it doesn't seem to be
 the case AFAICT.

 I've installed the devel version in the last week without issues and
 the confusionMatrix code has been touched in a while.

 Thanks,

 Max

 sessionInfo()
 R version 2.11.1 (2010-05-31)
 x86_64-apple-darwin9.8.0

 locale:
 [1] 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

 other attached packages:
 [1] caret_4.71     reshape_0.8.3  plyr_1.2.1     lattice_0.18-8

 loaded via a namespace (and not attached):
 [1] grid_2.11.1


 pkg_kuhna03$ R CMD INSTALL caret
 * installing to library ‘/Library/Frameworks/R.framework/Resources/library’
 * installing *source* package ‘caret’ ...
 ** libs
 *** arch - i386
 gcc -arch i386 -std=gnu99
 -I/Library/Frameworks/R.framework/Resources/include
 -I/Library/Frameworks/R.framework/Resources/include/i386
 -I/usr/local/include    -fPIC  -g -O2 -c caret.c -o caret.o
 gcc -arch i386 -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names
 -undefined dynamic_lookup -single_module -multiply_defined suppress
 -L/usr/local/lib -o caret.so caret.o
 -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework
 -Wl,CoreFoundation
 installing to 
 /Library/Frameworks/R.framework/Resources/library/caret/libs/i386
 *** arch - x86_64
 gcc -arch x86_64 -std=gnu99
 -I/Library/Frameworks/R.framework/Resources/include
 -I/Library/Frameworks/R.framework/Resources/include/x86_64
 -I/usr/local/include    -fPIC  -g -O2 -c caret.c -o caret.o
 gcc -arch x86_64 -std=gnu99 -dynamiclib
 -Wl,-headerpad_max_install_names -undefined dynamic_lookup
 -single_module -multiply_defined suppress -L/usr/local/lib -o caret.so
 caret.o -F/Library/Frameworks/R.framework/.. -framework R
 -Wl,-framework -Wl,CoreFoundation
 installing to 
 /Library/Frameworks/R.framework/Resources/library/caret/libs/x86_64
 ** R
 ** data
 ** inst
 ** preparing package for lazy loading
 Loading required package: plyr

 Attaching package: 'reshape'

 The following object(s) are masked from 'package:plyr':

    round_any

 ** help
 *** installing help indices
 ** building package indices ...
 ** testing if installed package can be loaded
 Error : object 'confusionMatrix' not found whilst loading namespace 'caret'
 ERROR: loading failed
 * removing ‘/Library/Frameworks/R.framework/Resources/library/caret’
 * restoring previous ‘/Library/Frameworks/R.framework/Resources/library/caret’


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


Re: [Rd] object not found whilst loading namespace

2011-03-15 Thread Duncan Murdoch

On 11-03-15 9:59 PM, Max Kuhn wrote:

Please disregard the last email...

The issue was a syntactical error in a file that, alphabetically,
comes before confusionMatrix.R in the package.

The odd thing was that the problem in this file did not throw and
error (or I would have easily found it). I decided to source the R
files one by one to see if there were any issues and that showed the
problem:


source(~/Code/caret/pkg/caret/R/classLevels.R)

Error in source(~/Code/caret/pkg/caret/R/classLevels.R) :
   ~/Code/caret/pkg/caret/R/classLevels.R:150:0: unexpected end of input



The files are concatenated into one big file which is sourced.  You've 
got an unclosed parenthesis/brace/bracket in this file, but some later 
file closed it -- so that file probably has an extra closing one.


Duncan Murdoch


Thanks anyway,

Max



On Tue, Mar 15, 2011 at 9:48 PM, Max Kuhnmxk...@gmail.com  wrote:

I've been updating a package and, when installing a local devel
version, I get an error object 'confusionMatrix' not found whilst
loading namespace. Looking around online, it appears that this might
be related to loading a specific RData file, but it doesn't seem to be
the case AFAICT.

I've installed the devel version in the last week without issues and
the confusionMatrix code has been touched in a while.

Thanks,

Max


sessionInfo()

R version 2.11.1 (2010-05-31)
x86_64-apple-darwin9.8.0

locale:
[1] 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

other attached packages:
[1] caret_4.71 reshape_0.8.3  plyr_1.2.1 lattice_0.18-8

loaded via a namespace (and not attached):
[1] grid_2.11.1


pkg_kuhna03$ R CMD INSTALL caret
* installing to library ‘/Library/Frameworks/R.framework/Resources/library’
* installing *source* package ‘caret’ ...
** libs
*** arch - i386
gcc -arch i386 -std=gnu99
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/i386
-I/usr/local/include-fPIC  -g -O2 -c caret.c -o caret.o
gcc -arch i386 -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names
-undefined dynamic_lookup -single_module -multiply_defined suppress
-L/usr/local/lib -o caret.so caret.o
-F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework
-Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Resources/library/caret/libs/i386
*** arch - x86_64
gcc -arch x86_64 -std=gnu99
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/x86_64
-I/usr/local/include-fPIC  -g -O2 -c caret.c -o caret.o
gcc -arch x86_64 -std=gnu99 -dynamiclib
-Wl,-headerpad_max_install_names -undefined dynamic_lookup
-single_module -multiply_defined suppress -L/usr/local/lib -o caret.so
caret.o -F/Library/Frameworks/R.framework/.. -framework R
-Wl,-framework -Wl,CoreFoundation
installing to 
/Library/Frameworks/R.framework/Resources/library/caret/libs/x86_64
** R
** data
** inst
** preparing package for lazy loading
Loading required package: plyr

Attaching package: 'reshape'

The following object(s) are masked from 'package:plyr':

round_any

** help
*** installing help indices
** building package indices ...
** testing if installed package can be loaded
Error : object 'confusionMatrix' not found whilst loading namespace 'caret'
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Resources/library/caret’
* restoring previous ‘/Library/Frameworks/R.framework/Resources/library/caret’



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


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


[Rd] .libPaths() on Windows may return duplicated paths

2011-03-15 Thread Henrik Bengtsson
In R v2.12.2 patched (2011-03-13 r54787) and also in R v2.13.0 devel
(2011-03-15 r54806), .libPaths() may return the multiple paths
referring to the same normalized path name.  Here is an example from
Rterm --vanilla using R v2.12.2 patched:

 paths - .libPaths(c(C:/, C:\\))
 paths
[1] C:/
[2] C:\\
[3] C:/PROGRA~1/R/R-2.13.0dev/library

The reason is that .libPaths() does not detect paths[1] and paths[2]
to be equal;

 .libPaths
function (new)
{
if (!missing(new)) {
new - Sys.glob(path.expand(new))
paths - unique(path.expand(c(new, .Library.site, .Library)))
.lib.loc - paths[file.info(paths)$isdir %in% TRUE]
}
else .lib.loc
}

One solution would be to replace:

  paths - unique(path.expand(c(new, .Library.site, .Library)))

with

  paths - path.expand(c(new, .Library.site, .Library))
  paths - utils::normalizePath(paths)
  paths - unique(paths)

This would obviously not work because this would make .libPaths()
depend on the utils package as standing.  Migrating normalizePath() to
the 'base' package would be one solution.


Finally, this causes update.packages() to try to download and install
the same package multiple times, e.g.

 .libPaths()
[1] C:\\Users\\hb/R/win-library/2.12
[2] C:/PROGRA~1/R/R-2.12.2patched/library
[3] C:\\Users\\hb\\R\\win-library\\2.12

 update.packages()
digest :
 Version 0.4.1 installed in C:\Users\hb/R/win-library/2.12
 Version 0.4.2 available at http://cran.stat.ucla.edu
Update (y/N/c)?  y
digest :
 Version 0.4.1 installed in C:\Users\hb\R\win-library\2.12
 Version 0.4.2 available at http://cran.stat.ucla.edu
Update (y/N/c)?  y
...

Obviously, I know how to fix/avoid this myself, but I figured it is
more generic if .libPaths() does it for everyone.

/Henrik

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