Re: [Rd] Installing a Tcl/Tk Extension on OSX

2010-09-02 Thread Philippe Grosjean
This is relatively simple if you can find the packages you need in the 
default Tcl/Tk install on the Mac (/System/Library/Tcl) and if these 
packages are compatibles with the X11 Tcl/Tk used by R. This should be 
fine for packages containing no compiled code. For the others, you 
should check first (but for instance, Img and tsl work for me - Mac OS X 
10.6.4). You can then use these package in R own Tcl environment like this:


 library(tcltk)
Loading Tcl/Tk interface ... done
 addTclPath(/System/Library/Tcl)
 tclRequire(Img)
Tcl 1.4

Best,

Philippe

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

On 01/09/10 18:16, Adrian Waddell wrote:

Dear R-Community,

I need the Img tk extension for my R package. It all works on my Ubuntu
machine (libtk-img). However I experience a great deal of trouble when I
try to install the package on OSX 10.5 or 10.6 (in fact I'm not able to
do it).

As I understand it, the ActiveTcl with it's teacup package manager do
not have an effect on the the x11 tcl installation which R accesses.
MacPorts however has the libtk-img package not listed and compiling it
from the source (with configure, make all, make install) does not do the
job either for me (adding the compiled package folder to auto_path).

Now, as I would like some R users to once use my R package (once it's on
CRAN), installing the Img tk extension should to be a fairly easy task
on OSX .

Can anybody tell me how I best tackle this problem in a way, such that
OSX R users (and myself) in future can easily install the Img tk package?

Sincerely,

Adrian Waddell

__
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] CMD check: checking data for non-ASCII characters is very time consuming

2010-09-02 Thread Vincent Carey
Checking data for non-ASCII characters takes a very long time for
packages with substantial data components.
Could the check be done manually by the developer, and a switch
introduced to optionally skip this during check?

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


Re: [Rd] Assignment of individual values to data frame columns: intentional or unintentional behavior?

2010-09-02 Thread Peter Ehlers

On 2010-08-05 12:14, Ulrike Grömping wrote:

Gabor Grothendieck schrieb:

On Thu, Aug 5, 2010 at 12:24 PM, Ulrike Grömping
groemp...@bht-berlin.de  wrote:


Dear developeRs,

I have just discovered a strange feature when assigning some values to
columns of a data frame: The column is matched by partial matching (as
documented), but when assigning a value, a new column with the partial name
is added to the data frame that is identical to the original column except
for the changed value. Is that intentional ? An example:



Note that the lack of partial matching when performing assignment is
also documented.

See second last paragraph in Details section of ?Extract


Yes, I see, thanks. I looked at ?[.data.frame, where this is not
documented.

However, given the documentation that partial matching is not used on
the left-hand side, I would have expected even more that the assignment

sw$Fert[1]- 10

works differently, because I am using it on the left-hand side.
Probably, extraction ([1]) is done first here, so that the right-hand
side won. At least, this is very confusing.

Best, Ulrike


This is another example of why it's a good idea to avoid
the '$' notation when fiddling with data frames. Try this:

 sw - swiss[1:5, 1:4]
 sw[[Fert]]
 sw[[Fert]] - 10

and my preferred version:
 sw[, Fert]
 sw[, Fert] - 10

I've never liked partial matching for data frames.

  -Peter Ehlers

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


[Rd] S4 Method Signatures

2010-09-02 Thread Dario Strbenac
Hello,

If the signature of a method defines which generic it implements then I'm 
confused about why this minimal example I invented won't work :

setGeneric(myFun, function(rs, ...){standardGeneric(myFun)})
setGeneric(myFun, function(cs, ...){standardGeneric(myFun)})

setMethod(myFun, numeric, function(rs, colour = Blue)
{
cat(rs*100, colour)
})

setMethod(myFun, character, function(cs, colour = Red)
{
cat(cs, colour)
})

Thanks for any tips,
Dario.

--
Dario Strbenac
Research Assistant
Cancer Epigenetics
Garvan Institute of Medical Research
Darlinghurst NSW 2010
Australia

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


Re: [Rd] Installing a Tcl/Tk Extension on OSX

2010-09-02 Thread Adrian Waddell
Thanks, that works actually out of the box from a fresh OSX 10.6
installation. So no ActiveTcl is needed. This is great!

Greetings,

Adrian


On 09/02/2010 05:01 AM, Philippe Grosjean wrote:
 This is relatively simple if you can find the packages you need in the
 default Tcl/Tk install on the Mac (/System/Library/Tcl) and if these
 packages are compatibles with the X11 Tcl/Tk used by R. This should be
 fine for packages containing no compiled code. For the others, you
 should check first (but for instance, Img and tsl work for me - Mac OS
 X 10.6.4). You can then use these package in R own Tcl environment
 like this:

  library(tcltk)
 Loading Tcl/Tk interface ... done
  addTclPath(/System/Library/Tcl)
  tclRequire(Img)
 Tcl 1.4

 Best,

 Philippe

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

 On 01/09/10 18:16, Adrian Waddell wrote:
 Dear R-Community,

 I need the Img tk extension for my R package. It all works on my Ubuntu
 machine (libtk-img). However I experience a great deal of trouble when I
 try to install the package on OSX 10.5 or 10.6 (in fact I'm not able to
 do it).

 As I understand it, the ActiveTcl with it's teacup package manager do
 not have an effect on the the x11 tcl installation which R accesses.
 MacPorts however has the libtk-img package not listed and compiling it
 from the source (with configure, make all, make install) does not do the
 job either for me (adding the compiled package folder to auto_path).

 Now, as I would like some R users to once use my R package (once it's on
 CRAN), installing the Img tk extension should to be a fairly easy task
 on OSX .

 Can anybody tell me how I best tackle this problem in a way, such that
 OSX R users (and myself) in future can easily install the Img tk
 package?

 Sincerely,

 Adrian Waddell

 __
 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

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