Re: [Rd] different results on linux and windows

2009-05-14 Thread Kjell Konis
Hi Klaus, Why not just use R's random number generator? See section 6.3 of Writing R Extensions. It should give you the same sequence of pseudorandom numbers on all platforms. HTH, Kjell On 12 mai 09, at 12:30, Klaus Nordhausen wrote: Dear R experts, we are preparing an R-package to com

Re: [Rd] Matrix with random number

2009-07-01 Thread Kjell Konis
Hi Fabio, Your function myrbeta returns void so assigning the output isn't going to work. Instead you need to call it like a FORTRAN subroutine. Also, I added arguments for the parameters of the beta and moved the fseedi and fseedo calls outside of the loop. This is a pretty basic FORTR

[Rd] strange bug? with R CMD check

2009-07-21 Thread Kjell Konis
saved object, the session will be unable to start. Probably some imports need to be declared in the NAMESPACE file. Here is the contents of the DESCRIPTION: Package: safeBinaryRegression Version: 0.1-2 Date: 2009-07-01 Title: Safe Binary Regression Author: Kjell Konis Maintainer: Kjell K

Re: [Rd] strange bug? with R CMD check

2009-07-22 Thread Kjell Konis
solved this, because I just downloaded your svn files and there's no more "sbr" and the check passes on my system. Right? pj On Tue, Jul 21, 2009 at 8:32 AM, Kjell Konis wrote: Hello, I am trying to get a package to pass R CMD check on an iMac running Mac OS X. When the p

Re: [Rd] Building R package with .c sub-routine files

2009-09-15 Thread Kjell Konis
Create a file named Makevars in the same directory and put the following line in it: OBJECTS=file1.o Then R CMD SHLIB will only compile file1.c. Kjell On Sep 15, 2009, at 8:04 PM, pleyd...@supagro.inra.fr wrote: Lets say I have two source files file1.c and file2.c The latter just contain

[Rd] interrupting native code

2008-05-15 Thread Kjell Konis
Hello, I have some native code that I would like to allow users to interrupt. However, I would like to do it more gracefully than with R_CheckUserInterrupt(). The solution I came up with is to call the following abort function periodically - if it returns 1 then I clean up and return. i

Re: [Rd] interrupting native code

2008-05-16 Thread Kjell Konis
On Thu, 15 May 2008, Kjell Konis wrote: Hello, I have some native code that I would like to allow users to interrupt. However, I would like to do it more gracefully than with R_CheckUserInterrupt(). The solution I came up with is to call the following abort function periodically - if it re

Re: [Rd] interrupting native code

2008-05-16 Thread Kjell Konis
eturn(1); } R_CallBackHook(); if(R_tcldo) R_tcldo(); #else R_PolledEvents(); if (R_interrupts_pending) return(1); #endif return(0); } On 16 mai 08, at 12:43, Prof Brian Ripley wrote: On Fri, 16 May 2008, Kjell Konis wrote: The problem is that my package us

Re: [Rd] interrupting native code

2008-05-20 Thread Kjell Konis
luke On Fri, 16 May 2008, Kjell Konis wrote: You mean something like this (I return 1 instead of calling onintr())? Will HAVE_AQUA and Win32 be appropriately defined when building my package (I can't see how to check with R CMD config)? int My_CheckUserInterrupt(void) { R_Che

Re: [Rd] interrupting native code

2008-05-21 Thread Kjell Konis
I can respond to it before onintr() gets called. Kjell On 20 mai 08, at 19:22, Simon Urbanek wrote: On May 20, 2008, at 10:58 AM, Kjell Konis wrote: I would actually prefer a mechanism that simply returns a flag indicating that an interrupt has been requested. Then I would be able to cle

[Rd] how to install header files in package

2008-06-13 Thread Kjell Konis
Is there a way to get R CMD INSTALL (and friends) to copy the header files from a source package's src directory to the include directory? Thanks. Kjell __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] how to install header files in package

2008-06-13 Thread Kjell Konis
3 Jun 2008, Dirk Eddelbuettel wrote: On 13 June 2008 at 14:28, Kjell Konis wrote: | Is there a way to get R CMD INSTALL (and friends) to copy the header | files from a source package's src directory to the include directory? Only if you (ab-)use the 'make all' target in src/Ma

Re: [Rd] R, Macports and C++ streams

2008-07-30 Thread Kjell Konis
I found this in Writing R Extensions: "Using C++ iostreams, as in this example, is best avoided. There is no guarantee that the output will appear in the R console, and indeed it will not on the R for Windows console. Use R code or the C entry points (see Printing) for all I/O if at all pos

Re: [Rd] R, Macports and C++ streams

2008-07-31 Thread Kjell Konis
Ernest, Is it possible to provide a reproducible example of your crash? Kjell On Jul 30, 2008, at 6:32 PM, Ernest Turro wrote: On 30 Jul 2008, at 15:46, Simon Urbanek wrote: On Jul 30, 2008, at 9:45 , Ernest Turro wrote: Dear all, R on Macports relies on GCC 4.3 to build packages. I f

[Rd] string comparison

2008-08-07 Thread Kjell Konis
Hi, I have a package where I do things like this a lot: if(strncmp(CHAR(asChar(Scategory)), "chance", 6) == 0) category = h_category_chance; else if(strncmp(CHAR(asChar(Scategory)), "utility", 7) == 0) category = h_category_utility; else if(strncmp(CHAR(asChar(Scategory)), "decisio

[Rd] the %ProgramFiles% variable

2008-09-02 Thread Kjell Konis
Hello, I want to use the %ProgramFiles% variable in a Sys.setenv (R 2.7.2, Windows) but it always seems to get handled literally. For instance, in cmd.exe I get what I want C:\Documents and Settings\user>echo %ProgramFiles% C:\Program Files but in R > system("echo %ProgramFiles%") %Pro

Re: [Rd] calculating means per group

2008-09-04 Thread Kjell Konis
Hi Luc, First of all, questions like this should really be asked on the R-help mailing list. The tapply function does what you want: > year [1] 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 Levels: 1 2 > area [1] a a a a a b b b b a a a a b b b b b Levels: a b > value [1] 20 25 28 31 23 25 28 23 19

Re: [Rd] Label justification (axis) (PR#13307)

2008-11-21 Thread Kjell Konis
If you want to change the orientation of the axis labels you use las. If you want to change the horizontal justification of the axis labels you use hadj. If you want to change the orientation of the axis labels and the horizontal justification of the axis labels then you use las and hadj at

Re: [Rd] Generate random numbers in Fortran

2009-02-13 Thread Kjell Konis
Take a look at section 6.6 in Writing R Extensions. It describes how to call C functions from FORTRAN. Basically it just boils down to this, in a C file define the functions void F77_SUB(fseedi)(void) { int x = 100; seed_in(&x); } void F77_SUB(fseedo)(void) { int x = 100; seed_out(&

Re: [Rd] Generate random numbers in Fortran

2009-02-14 Thread Kjell Konis
haracter in statement label at (1) > blah.f:4.1: > > end > 1 > Erro: Unclassifiable statement at (1) > make: ** [blah.o] Erro 1 > > > Fábio Mathias Corrêa >UFLA > > > --- Em sex, 13/2/09, Kjell Konis escreveu: > De: Kjell Konis > As

[Rd] demo enhancement

2009-02-16 Thread Kjell Konis
Hello, I have a package for working with Bayesian networks (RHugin - on R- Forge for those interested). It contains a function RHExample that does the same thing as the demo function in the utils package except that it does not display any output in the R console. I use it to build simple

Re: [Rd] demo enhancement

2009-02-16 Thread Kjell Konis
I put the diff here http://smat.epfl.ch/~konis/grabbag/demo.diff Kjell On 16 févr. 09, at 12:35, Duncan Murdoch wrote: Kjell Konis wrote: Hello, I have a package for working with Bayesian networks (RHugin - on R- Forge for those interested). It contains a function RHExample that does the

[Rd] copy an external pointer on assignment

2009-02-23 Thread Kjell Konis
Is there a mechanism in R for copying the business end of an external pointer on assignment? For instance, if x is an external pointer and I enter > y <- x I would like to make a copy of the structure that x refers to and assign its address to y. Thanks, Kjell ___

Re: [Rd] R_alloc problems in R v1.11

2005-07-06 Thread Kjell Konis
On 6 Jul 2005, at 22:06, Uwe Ligges wrote: > Marie-Hélène Ouellette wrote: > >> I'm using the R v1.11 on Macintoch and I seem to have a problem >> with the >> > > There is no version 1.11, and there never was. Current is 2.1.1 > anything > older than 2.x.y is unsupported these days. The lates