From ligges at statistik.uni-dortmund.de  Tue Apr 22 19:44:20 2003
From: ligges at statistik.uni-dortmund.de (ligges@statistik.uni-dortmund.de)
Date: Tue Apr 22 18:44:39 2003
Subject: [Rd] Handling of upper/lowercase in package names (PR#2816)
Message-ID: <200304221644.h3MGiKpD014259@pubhealth.ku.dk>

phgrosjean@sciviews.org wrote:
> Hi,
> 
> This is (presumably?) a bug in R 1.7.0 under Windows. I have not tested it
> on other systems. Attachment of packages is case sensitive but not
> library(), resulting in multiple loadings of the same package if the library
> name is spelled differently. The following example loads the `tools'
> package, once as `tools' and once as `Tools'. This behavior is the same with
> all packages and it occurs also in R 1.6.2.

Two ways of fixing it, check in library() for .Platform$OS.type == "windows"

a) whether a package was attached by non-case sensitive spelling, e.g.:
     match(tolower(pckname), tolower(search))

b)  for correct (case sensitive) spelling of the package name, e.g. by 
reading the DESCRIPTION file *before* attaching the package.

Each one way seems to be easy, but which is preferred R-Core?
a) won't break windows specific code, b) might do so, but is more 
consistent.

Uwe Ligges

> 
>>library(tools)
>>search()
> 
>  [1] ".GlobalEnv"      "package:tools"   "package:methods" "package:ctest"
> "package:mva"
>  [6] "package:modreg"  "package:nls"     "package:ts"      "Autoloads"
> "package:base"
> 
>>library(Tools)
> 
> 
> Attaching package 'Tools':
> 
> 
>         The following object(s) are masked from package:tools :
> 
>          .checkDemoIndex .checkVignetteIndex .installMD5sums
> .installPackageDescription .installPackageIndices buildVignettes
> checkAssignFuns checkDocArgs checkDocStyle checkFF checkMD5sums checkMethods
> checkTnF checkVignettes codoc md5sum pkgVignettes print.checkAssignFuns
> print.checkDemoIndex print.checkDocArgs print.checkDocStyle print.checkFF
> print.checkMethods print.checkTnF print.checkVignetteIndex
> print.checkVignettes print.codoc print.undoc Rdindex Rtangle RtangleSetup
> RtangleWritedoc RweaveLatex RweaveLatexOptions RweaveLatexSetup Stangle
> Sweave SweaveSyntaxLatex SweaveSyntaxNoweb SweaveSyntConv undoc
> 
> 
>>search()
> 
>  [1] ".GlobalEnv"      "package:Tools"   "package:tools"   "package:methods"
> "package:ctest"
>  [6] "package:mva"     "package:modreg"  "package:nls"     "package:ts"
> "Autoloads"
> [11] "package:base"
> 
> 
> Version:
>  platform = i386-pc-mingw32
>  arch = i386
>  os = mingw32
>  system = i386, mingw32
>  status =
>  major = 1
>  minor = 7.0
>  year = 2003
>  month = 04
>  day = 16
>  language = R
> 
> Windows XP Professional (build 2600) Service Pack 0.0
> 
> Search Path:
>  .GlobalEnv, package:Tools, package:tools, package:methods, package:ctest,
> package:mva, package:modreg, package:nls, package:ts, Autoloads,
> package:base
> 
> Best,
> 
> Philippe Grosjean
> 
> ...........]<(({?<...............<?}))><...............................
>  ) ) ) ) )
> ( ( ( ( (       Dr. Philippe Grosjean
>  ) ) ) ) )
> ( ( ( ( (       LOV, UMR 7093
>  ) ) ) ) )      Station Zoologique
> ( ( ( ( (       Observatoire Oc?anologique
>  ) ) ) ) )      BP 28
> ( ( ( ( (       06234 Villefranche sur mer cedex
>  ) ) ) ) )      France
> ( ( ( ( (
>  ) ) ) ) )      tel: +33.4.93.76.38.18, fax: +33.4.93.76.38.34
> ( ( ( ( (
>  ) ) ) ) )      e-mail: phgrosjean@sciviews.org
> ( ( ( ( (       SciViews project coordinator (http://www.sciviews.org)
>  ) ) ) ) )
> .......................................................................
> 
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-devel


[Rd] Handling of upper/lowercase in package names (PR#2816)
ligges@statistik.uni-dortmund.de