Re: [Rd] warning upon automatic close of connection

2007-09-12 Thread Seth Falcon
Gabor Grothendieck [EMAIL PROTECTED] writes:
 I noticed that under R 2.6.0 there is a warning about closing the connection
 in the code from this post:
 https://stat.ethz.ch/pipermail/r-help/2007-September/140601.html

 which is evidently related to the following from the NEWS file:

 o Connections will be closed if there is no R object referring to
   them.  A warning is issued if this is done, either at garbage
   collection or if all the connection slots are in use.

 If we use read.table directly it still happens:

 # use Lines and Lines2 from cited post
 library(zoo)
 DF1 - read.table(textConnection(Lines), header = TRUE)
 DF2 - read.table(textConnection(Lines2), header = TRUE)
 z1 - zoo(as.matrix(DF1[-1]), as.Date(DF1[,1], %d/%m/%Y))
 z2 - zoo(as.matrix(DF2[-1]), as.Date(DF2[,1], %d/%m/%Y))
 both - merge(z1, z2)
 plot(na.approx(both))

 R.version.string # Vista
 [1] R version 2.6.0 alpha (2007-09-06 r42791)

 Is this annoying warning really necessary?  I assume we can get rid of
 it by explicitly naming and closing the connections but surely there should
 be a way to avoid the warning without going to those lengths.

Up until the change you mention above it really was necessary to name
and close all connections.  Short scripts run in fresh R sessions may
not have had problems with code like you have written above, but
longer programs or shorter ones run in a long running R session would
run out of connections.

Now that connections have weak reference semantics, one can ask
whether this behavior should be standard and no warning issued.

 I would have thought that read.table opens the connection then it would
 close it itself so no warning would need to be generated.

In your example, read.table is _not_ opening the connection.  You are
passing an open connection which has no symbol bound to it:

   foo = 
   c = textConnection(foo)
   c
 descriptionclass mode text 
   foo textConnection  r   text 
  opened can readcan write 
openedyes no 

But I think passing a closed connection would cause the same sort of
issue.  It seems that there are two notions of closing a connection:
(i) close as the opposite of open, and (ii) clean up the entire
connection object.  I haven't looked closely at the code here, so I
could be wrong, but I'm basing this guess on the following:

 file(foo)
description   classmodetext  openedcan read 
  foo  file r  textclosed   yes 
  can write 
  yes 
## start new R session
for (i in 1:75) file(foo)
gc()
warnings()[1:3]
 gc()
 used (Mb) gc trigger (Mb) max used (Mb)
Ncells 149603  4.0 35  9.4   35  9.4
Vcells 101924  0.8 786432  6.0   486908  3.8
There were 50 or more warnings (use warnings() to see the first 50)
 warnings()[1:3]
$`closing unused connection 76 (foo)`
NULL

$`closing unused connection 75 (foo)`
NULL

$`closing unused connection 74 (foo)`
NULL


-- 
Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center
BioC: http://bioconductor.org/
Blog: http://userprimary.net/user/

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


[Rd] Font problem (PR#9906)

2007-09-12 Thread manuel . munoz
Full_Name: M. Muñoz Márquez
Version: 2.3.1
OS: Ubuntu
Submission from: (NULL) (150.214.231.66)


Here is the reply to the edit command using gnome
 edit(data.frame())
Erro en dataentry(datalist, modes) : invalid device
Además: Warning message:
unable to create fontset -*-fixed-medium-r-normal--13-*-*-*-*-*-*-* 
 Sys.getlocale()
[1] 
LC_CTYPE=es_ES.UTF-8;LC_NUMERIC=C;LC_TIME=es_ES.UTF-8;LC_COLLATE=es_ES.UTF-8;LC_MONETARY=es_ES.UTF-8;LC_MESSAGES=es_ES.UTF-8;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C

Under kde it works fine.

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


Re: [Rd] Font problem (PR#9906)

2007-09-12 Thread Oleg Sklyar
OS: Ubuntu 7.10 Gutsy Gibbon
GNOME: 2.19.92 (build: 04/09/07)
Linux 2.6.22-10-generic #1 SMP x86_64 GNU/Linux

It works perfectly fine here with 2 recent versions of R (errors because
dialogues closed without any data):

* ~: Rd
R version 2.7.0 Under development (unstable) (2007-09-06 r42789) 
 edit(data.frame())
Error in max(lengths) : invalid 'type' (list) of argument
 
* ~: R
R version 2.5.1 (2007-06-27) 
 edit(data.frame())
Error in max(..., na.rm = na.rm) : invalid 'type' (list) of argument
 



On Wed, 2007-09-12 at 16:52 +0200, [EMAIL PROTECTED] wrote:
 Full_Name: M. Muñoz Márquez
 Version: 2.3.1
 OS: Ubuntu
 Submission from: (NULL) (150.214.231.66)
 
 
 Here is the reply to the edit command using gnome
  edit(data.frame())
 Erro en dataentry(datalist, modes) : invalid device
 Además: Warning message:
 unable to create fontset -*-fixed-medium-r-normal--13-*-*-*-*-*-*-* 
  Sys.getlocale()
 [1] 
 LC_CTYPE=es_ES.UTF-8;LC_NUMERIC=C;LC_TIME=es_ES.UTF-8;LC_COLLATE=es_ES.UTF-8;LC_MONETARY=es_ES.UTF-8;LC_MESSAGES=es_ES.UTF-8;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C
 
 Under kde it works fine.
 
 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel
-- 
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] Font problem (PR#9906)

2007-09-12 Thread Dirk Eddelbuettel
On Wed, Sep 12, 2007 at 04:52:19PM +0200, [EMAIL PROTECTED] wrote:
 Full_Name: M. Muñoz Márquez
 Version: 2.3.1

Note that this is over a year out of date ...

 OS: Ubuntu

... even though the R FAQ tells you that you can get current R
versions for Ubuntu from all CRAN mirror with a simple apt-get.

 Submission from: (NULL) (150.214.231.66)
 
 
 Here is the reply to the edit command using gnome
  edit(data.frame())
 Erro en dataentry(datalist, modes) : invalid device
 Además: Warning message:
 unable to create fontset -*-fixed-medium-r-normal--13-*-*-*-*-*-*-* 
  Sys.getlocale()
 [1] 
 LC_CTYPE=es_ES.UTF-8;LC_NUMERIC=C;LC_TIME=es_ES.UTF-8;LC_COLLATE=es_ES.UTF-8;LC_MONETARY=es_ES.UTF-8;LC_MESSAGES=es_ES.UTF-8;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C
 
 Under kde it works fine.

Demonstrating that it is a local admin problem that your fonts aren't
right.  IIRC there was an Ubuntu issue that /etc/X11/xorg.conf ended
up with a misspecified font path.  FWIW, I use 

Section Files
FontPath/usr/share/fonts/X11/misc
FontPath/usr/share/fonts/X11/cyrillic
FontPath/usr/share/fonts/X11/100dpi/:unscaled
FontPath/usr/share/fonts/X11/75dpi/:unscaled
FontPath/usr/share/fonts/X11/Type1
FontPath/usr/share/fonts/X11/100dpi
FontPath/usr/share/fonts/X11/75dpi
#
FontPath/usr/share/X11/fonts/misc
FontPath/usr/share/X11/fonts/cyrillic
FontPath/usr/share/X11/fonts/100dpi/:unscaled
FontPath/usr/share/X11/fonts/75dpi/:unscaled
FontPath/usr/share/X11/fonts/Type1
FontPath/usr/share/X11/fonts/100dpi
FontPath/usr/share/X11/fonts/75dpi
FontPath/usr/share/X11/fonts/misc
# path to defoma fonts
FontPath/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType
EndSection


Hoep this helps,  Dirk

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

-- 
Three out of two people have difficulties with fractions.

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


[Rd] installing packages (PR#9907)

2007-09-12 Thread alexander . jerneck
Full_Name: Alexander Jerneck
Version: 2.4.0 (2006-10-03)
OS: Gentoo (2.6.17-custom kernel)
Submission from: (NULL) (130.91.92.78)


I had trouble installing R packages, either from inside R or from the
commandline, with R complaining about not finding /usr/bin/pwd
I have pwd in /bin/ so I created a symlink from /usr/bin/pwd to /bin/pwd and now
I can install packages. I do not know where the original problem is however.

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


Re: [Rd] could not find function in R CMD check [solved, but is this an R bug?]

2007-09-12 Thread Ross Boylan
On Wed, 2007-09-12 at 11:31 +0200, Uwe Ligges wrote:
 Perhaps Namespace issues? But no further ideas. You might want to make 
 your package available at some URL so that people can look at it and help...
 
 Uwe Ligges
 
Thanks.  The problem lay elsewhere.  I was able to fix it by adding 
library(mspath)
to the top of the .R file in data/ that defined some data using the
package's functions  In other words
---
library(mspath)
### from various papers on errors in reading fibrosis scores
rousselet.jr - readingError(c(.91, .09, 0, 0, 0,
   .11, .78, .11, 0, 0,
   0, .17, .75, .08, 0,
   0, .06, .44, .50, 0,
   0, 0, 0, .07, .93),
 byrow=TRUE, nrow=5, ncol=5)
-
works as data/readingErrorData.R, but without the library() call I  get
the error shown in my original message (see below).  readingError() is a
function defined in my package.

Does any of this inndicate a bug or undesirable feature in R?

First, it seems a little odd that I need to include loading the library
in data that is defined in the same library.  I think I've noticed
similar behavior in other places, maybe the code snippets that accompany
the documentation pages (that is, one needs library(mypackage) in order
for the snippets to check out).

Second, should R CMD check fail so completely and opaquely in this
situation?


 
 Ross Boylan wrote:
  During R CMD check I get this:
  ** building package indices ...
  Error in eval(expr, envir, enclos) : could not find function
  readingError
  Execution halted
  ERROR: installing package indices failed
  
  The check aborts there.  readingError is a function I just added; for
  reference
  setClass(readingError, contains=matrix)
  readingError - function(...) new(readingError, matrix(...))
  which is in readingError.R in the project's R subdirectory.
  
  Some code in the data directory invokes readingError, and the .Rd file
  includes \alias{readingError}, \alias{readingError-class},
  \name{readingError-class} and an example invoking readingError.
  
  I'm using R 2.5.1 as packaged for Debian GNU/Linux.
  
  Does anyone have an idea what's going wrong here, or how to fix or debug
  it?
  
  The code seems to work OK when I use it from ESS.

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


[Rd] trivial typo in ?strip.default

2007-09-12 Thread Ben Bolker
under factor.levels:  specicifying

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


Re: [Rd] installing packages (PR#9907)

2007-09-12 Thread Charles C. Berry
On Wed, 12 Sep 2007, [EMAIL PROTECTED] wrote:

 Full_Name: Alexander Jerneck
 Version: 2.4.0 (2006-10-03)
 OS: Gentoo (2.6.17-custom kernel)
 Submission from: (NULL) (130.91.92.78)


 I had trouble installing R packages, either from inside R or from the
 commandline, with R complaining about not finding /usr/bin/pwd
 I have pwd in /bin/ so I created a symlink from /usr/bin/pwd to /bin/pwd and 
 now
 I can install packages. I do not know where the original problem is however.

This is NOT A BUG.

Likely, you do not have /bin on your path. Check

Sys.getenv(PATH)


install.packages() works fine on all my Gentoo boxes with R installed as 
per the instructions in

$R_HOME/doc/manual/R-admin.html


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


Charles C. Berry(858) 534-2098
 Dept of Family/Preventive Medicine
E mailto:[EMAIL PROTECTED]  UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901

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


Re: [Rd] installing packages (PR#9907)

2007-09-12 Thread Paul Gilbert
I don't think this is a bug in R.

I believe a (not too) recent change in Gentoo removed /usr/bin/pwd so 
that the only one left is /bin/pwd. R seems to remember from install 
time where to find these utilities, and probably found /usr/bin/pwd when 
you installed the not recent version of R. You found one workaround, and 
another would be a fresh install of R.

Paul

[EMAIL PROTECTED] wrote:
 Full_Name: Alexander Jerneck
 Version: 2.4.0 (2006-10-03)
 OS: Gentoo (2.6.17-custom kernel)
 Submission from: (NULL) (130.91.92.78)
 
 
 I had trouble installing R packages, either from inside R or from the
 commandline, with R complaining about not finding /usr/bin/pwd
 I have pwd in /bin/ so I created a symlink from /usr/bin/pwd to /bin/pwd and 
 now
 I can install packages. I do not know where the original problem is however.
 
 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel


La version française suit le texte anglais.



This email may contain privileged and/or confidential inform...{{dropped}}

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


Re: [Rd] installing packages (PR#9907)

2007-09-12 Thread Peter Dalgaard
[EMAIL PROTECTED] wrote:
 Full_Name: Alexander Jerneck
 Version: 2.4.0 (2006-10-03)
 OS: Gentoo (2.6.17-custom kernel)
 Submission from: (NULL) (130.91.92.78)


 I had trouble installing R packages, either from inside R or from the
 commandline, with R complaining about not finding /usr/bin/pwd
 I have pwd in /bin/ so I created a symlink from /usr/bin/pwd to /bin/pwd and 
 now
 I can install packages. I do not know where the original problem is however.
   
Please don't report it as a bug then! Or at least do more of your 
homework first.

As far as I can see, this is handled by the configure script which goes 
looking for pwd and records the result in $GETWD (in Makeconf and the 
INSTALL and REMOVE scripts). If you compile on one system and run on 
another, strange things can and will happen if they do not have things 
in the same places.  There are a few other places where pwd is called 
directly (texi2dvi and libtool) but I don't think that can give the 
error message you describe.

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