Re: [Rd] Shared Library Support for AIX?

2006-07-12 Thread Prof Brian Ripley
We are waiting for the community of users of R on AIX to put in the 
resources needed to make this happen. 

We receive little help from AIX users of R (with the shining exception of 
Ei-ji Nakama), for example I cannot recall a single alpha/beta test report 
on that platform, and I would hope to recall several a year.  So it is 
mainly due to inspired guesswork that R compiles on AIX.

Given that apparently we are able to build libRlapack as a shared library 
on AIX, the same recipe should work for libR.  (As far as I recall the 
difficulty is getting a suitable export file from the motly collection of 
objects that make up this shared library.)  But this really needs someone 
with detailed knowledge of AIX linkers to tackle it, as quite possibly 
there is a better approach.

On Tue, 11 Jul 2006, Matthew Beason wrote:

> Fellow R Enthusiasts,
> 
> I noted on the "R Installation and Administration" page, section C.9
> that "--enable-R-shlib" is reported not to work for AIX. Has anyone made
> any further progress with this as of late? I've successfully compiled R
> 2.3.1 on AIX 5.2ML7 and AIX 5.3ML3. However, I'd really like to use
> RSPerl so I can attack R with Perl. Is there a way to do this without
> shared libraries enabled? 
> 
> Any thoughts, advice, pointers would be greatly appreciated. 
> 
> Matthew Beason
> Analyst - Capacity Planning
> Harrah's Entertainment, Inc.
> One Harrah's Court, Las Vegas, NV 89119-4312
> Office: 702-494-4097
> Mobile: 702-622-6902
> [EMAIL PROTECTED]
> The information contained in this email may be legally privileged and
> confidential. It is intended to be read only by the person to whom it is
> addressed. If you have received this in error or are not the intended
> recipient, please immediately notify the sender and delete all copies of
> this message. Thank you.
> 
> 
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> 

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
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


Re: [Rd] Sweave processes comments incorrectly (PR#9073)

2006-07-12 Thread Friedrich Leisch
> On Tue, 11 Jul 2006 16:46:02 +0200 (CEST),
> krc  (k) wrote:

  > Full_Name: Kevin R. Coombes
  > Version: 2.1.0
 ^

Please note that this version of R is very outdated, please only
report bugs which are verified for the most recent version of R (in
this case it was still there, though).


  > OS: Windows XP
  > Submission from: (NULL) (143.111.22.24)

  > I have a source file "devel.Rnw" that uses the LaTeX foils class and 
ppower4 to
  > produce a PDF presentation file.  It starts with a commented note to myself 
as
  > follows:

[...]


Thanks a lot for the bug report, fixed in r-patched and
r-devel.

Best,
Fritz

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


Re: [Rd] [R] Date Format

2006-07-12 Thread Martyn Plummer
On Tue, 2006-07-11 at 20:05 +0200, Peter Dalgaard wrote:
> Martyn Plummer <[EMAIL PROTECTED]> writes:
> 
> > I moved this to R-devel because I am wondering why the base package does
> > not allow you to convert from numeric to Date. Could we not have
> > something like this?
> > 
> > as.Date.numeric <- function(x, epoch="1970-01-01", ...) {
> >if (!is.character(epoch) || length(epoch) != 1)
> >   stop("invalid epoch")
> >as.Date(epoch, ...) + x
> > }
> 
> We could, but you might as well do it explicitly. There's something to
> be said for not confusing the concept of dates with a particular
> implementation, which is effectively what happens if you can convert
> them to and from numeric too seamlessly.

Currently you can easily convert one way, but not the other. I just find
that a bit odd.

Pierre's problem was that his Date objects were converted internally by
some function.  His first instinct, to use as.Date to convert them back,
was, I think, correct. But that doesn't work. So now we say "You have to
understand how Date objects are implemented to get your dates back"? I
don't know about that.

> I'm more perplexed by the failure of adding difftimes to dates:
> 
> > as.Date("2006-1-1") + (as.Date("2006-1-1") - as.Date("2006-1-2"))
> [1] "2005-12-31"
> Warning message:
> Incompatible methods ("+.Date", "Ops.difftime") for "+"
> 
> and if you have a difftime in non-days units, you'll  actually get a
> wrong result:
> 
> > D1 <- as.Date("2006-1-1")
> > D2 <- as.Date("2006-1-2")
> > difftime(D2,D1,units="hours")
> Time difference of 24 hours
> > dd <- difftime(D2,D1,units="hours")
> > D1+dd
> [1] "2006-01-25"
> Warning message:
> Incompatible methods ("+.Date", "Ops.difftime") for "+"

[I raised this problem earlier in private discussions with Peter]

It certainly is perplexing. There is code in "+.Date" that correctly
handles the case where the second argument is a difftime. But it will
never get called! I wonder if it ever worked.

The warning is coming from DispatchGroup (in eval.c). When it finds
different methods for two arguments of a binary group generic, it gives
up and the default method is called - in this case R_binary in
arithmetic.c - which is why the results depends on the implementation of
the difftime object.

I guessed that this was a limitation of S3 generics, and I suppose I was
right.  To allow mixing arguments of two classes, you would need code in
Ops.foo to handle objects of class bar *and* vice versa.  It's a bad
idea to have two separate bits of code to do the same job, so I can't
fault the logic of forbidding this, but it does leave us with some
usability problems.

While we are on the topic, is there no function to convert a difftime
object from one time scale to another? I found a couple of private
functions, but nothing public.

Martyn



> > On Tue, 2006-07-11 at 12:58 -0400, Gabor Grothendieck wrote:
> > > Try this:
> > > 
> > > library(zoo)
> > > as.Date(11328)
> > > 
> > > See the Help Desk article in R News 4/1 for more on dates.
> > > 
> > > 
> > > On 7/11/06, pierre clauss <[EMAIL PROTECTED]> wrote:
> > > > Hi everybody,
> > > > I need your precious help for, I think, a simple request, but I do not 
> > > > manage to solve this.
> > > >
> > > > When I use a "table" function with dates in the rows, the rows are 
> > > > coerced to number after the table function.
> > > >
> > > > So I need to transform the row names into date format. But I do not 
> > > > manage.
> > > >
> > > > Therefore, for an example, I manage to write this :
> > > >
> > > > datetest<-"06/01/2001"
> > > > datetest<-as.Date(datetest,"%d/%m/%Y")
> > > > datetest<-as.numeric(datetest)
> > > >
> > > > to get 11328.
> > > >
> > > > But I do not obtain the inverse tranformation :
> > > >
> > > > datetest<-as.Date(datetest,"%d/%m/%Y")
> > > >
> > > > How do we get this please ?
> > > >
> > > > Thanks a lot for your solution.
> > > > Pierre.
> > > >
> > > >
> > 
> > ---
> > This message and its attachments are strictly confidential. ...{{dropped}}
> > 
> > __
> > R-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> > 
> 

---
This message and its attachments are strictly confidential. ...{{dropped}}

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


Re: [Rd] [R] Date Format

2006-07-12 Thread Prof Brian Ripley
On Wed, 12 Jul 2006, Martyn Plummer wrote:

> On Tue, 2006-07-11 at 20:05 +0200, Peter Dalgaard wrote:
> > Martyn Plummer <[EMAIL PROTECTED]> writes:
> > 
> > > I moved this to R-devel because I am wondering why the base package does
> > > not allow you to convert from numeric to Date. Could we not have
> > > something like this?
> > > 
> > > as.Date.numeric <- function(x, epoch="1970-01-01", ...) {
> > >if (!is.character(epoch) || length(epoch) != 1)
> > >   stop("invalid epoch")
> > >as.Date(epoch, ...) + x
> > > }
> > 
> > We could, but you might as well do it explicitly. There's something to
> > be said for not confusing the concept of dates with a particular
> > implementation, which is effectively what happens if you can convert
> > them to and from numeric too seamlessly.
> 
> Currently you can easily convert one way, but not the other. I just find
> that a bit odd.
> 
> Pierre's problem was that his Date objects were converted internally by
> some function.  His first instinct, to use as.Date to convert them back,
> was, I think, correct. But that doesn't work. So now we say "You have to
> understand how Date objects are implemented to get your dates back"? I
> don't know about that.

I agree with what we say: it was deliberate not to interpret plain 
numbers.

> > I'm more perplexed by the failure of adding difftimes to dates:
> > 
> > > as.Date("2006-1-1") + (as.Date("2006-1-1") - as.Date("2006-1-2"))
> > [1] "2005-12-31"
> > Warning message:
> > Incompatible methods ("+.Date", "Ops.difftime") for "+"
> > 
> > and if you have a difftime in non-days units, you'll  actually get a
> > wrong result:
> > 
> > > D1 <- as.Date("2006-1-1")
> > > D2 <- as.Date("2006-1-2")
> > > difftime(D2,D1,units="hours")
> > Time difference of 24 hours
> > > dd <- difftime(D2,D1,units="hours")
> > > D1+dd
> > [1] "2006-01-25"
> > Warning message:
> > Incompatible methods ("+.Date", "Ops.difftime") for "+"
> 
> [I raised this problem earlier in private discussions with Peter]
> 
> It certainly is perplexing. There is code in "+.Date" that correctly
> handles the case where the second argument is a difftime. But it will
> never get called! I wonder if it ever worked.

Yes, it worked before Ops.difftime was added.

> The warning is coming from DispatchGroup (in eval.c). When it finds
> different methods for two arguments of a binary group generic, it gives
> up and the default method is called - in this case R_binary in
> arithmetic.c - which is why the results depends on the implementation of
> the difftime object.
> 
> I guessed that this was a limitation of S3 generics, and I suppose I was
> right.  To allow mixing arguments of two classes, you would need code in
> Ops.foo to handle objects of class bar *and* vice versa.  It's a bad
> idea to have two separate bits of code to do the same job, so I can't
> fault the logic of forbidding this, but it does leave us with some
> usability problems.
> 
> While we are on the topic, is there no function to convert a difftime
> object from one time scale to another? I found a couple of private
> functions, but nothing public.

There is none: the intention is that the user should leave this to the 
functions he uses.

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
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


Re: [Rd] invalid alignment error in R-2.4.0

2006-07-12 Thread Simon Urbanek
Robin,

how did you compile your R? I know that old gcc 4 (as supplied by  
Apple) did indeed produce invalid code in quicksort that segfaulted,  
however, that was on an Intel Mac. You may want to use gcc 4.0.3 or  
later instead and see whether the problem is gone - R-devel from  
http://r.research.att.com/ is compiled with gcc 4.0.3 and it doesn't  
exhibit this behavior.

Cheers,
Simon

On Jul 11, 2006, at 5:04 AM, Robin Hankin wrote:

> Hi Martin
>
>
> On 11 Jul 2006, at 09:25, Martin Maechler wrote:
>
>> I assume this is specific to your installation of R-devel
>> (R-2.4.0 "unstable").  If I use your 'out',
>>hist(out^4, col = "gray")
>> works just fine consistently.
>>
>> Could it be a compiler / linker mismatch
>> on your Mac?  Also, can you run "under the debugger"
>>'R -d gdb' (from a commandline) ?
>>
>> This should allow a traceback ('backtrace', abbreviated 'bt' in  
>> "gdb")
>> of the C call stack.
>
>
>
> transcript follows:
>
>
> octopus:~/scratch% ./Rd/R.framework/Versions/2.4/Resources/bin/R -d  
> gdb
> GNU gdb 6.1-20040303 (Apple version gdb-434) (Wed Nov  2 17:28:16 GMT
> 2005)
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and
> you are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for
> details.
> This GDB was configured as "powerpc-apple-darwin"...Reading symbols
> for shared libraries ... done
>
> (gdb) R
> Starting program: /Users/rksh/scratch/Rd/R.framework/Versions/2.4/
> Resources/bin/exec/R
> Reading symbols for shared libraries ...+ done
>
> R version 2.4.0 Under development (unstable) (2006-07-09 r38523)
> Copyright (C) 2006 The R Foundation for Statistical Computing
> ISBN 3-900051-07-0
>
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
>
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
>
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
>
> Reading symbols for shared
> libraries ..
> done
> Reading symbols for shared libraries . done
> Reading symbols for shared libraries . done
>> load("~/f")
>> hist(out^4)
>
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_PROTECTION_FAILURE at address: 0x0012
> R_qsort (v=0x2855858, i=1, j=2) at qsort-body.c:126
> 126 vt = v[i + 1];
> (gdb) bt
> #0  R_qsort (v=0x2855858, i=1, j=2) at qsort-body.c:126
> #1  0x0111e5d4 in do_qsort (call=0x1d0ed04, op=0x1, args=0x1d0b7f8,
> rho=0x4) at qsort.c:89
> #2  0x010c9a1c in do_internal (call=0x1d0b7f8, op=0x1, args=0x0,
> env=0x1d0c494) at names.c:1091
> #3  0x01099bb4 in Rf_eval (e=0x1d0ec94, rho=0x1d0c494) at eval.c:425
> #4  0x0109ba10 in do_set (call=0x1d0fb78, op=0x180a390,
> args=0x1d0fb94, rho=0x1d0c494) at eval.c:1337
> #5  0x01099bb4 in Rf_eval (e=0x1d0fb78, rho=0x1d0c494) at eval.c:425
> #6  0x0109bc60 in do_begin (call=0x1d0fb40, op=0x180a2cc,
> args=0x1d0fb5c, rho=0x1d0c494) at eval.c:1101
> #7  0x01099bb4 in Rf_eval (e=0x1d0fb40, rho=0x1d0c494) at eval.c:425
> #8  0x01099bb4 in Rf_eval (e=0x1d0fa44, rho=0x1d0c494) at eval.c:425
> #9  0x0109ba10 in do_set (call=0x1d0f9f0, op=0x180a390,
> args=0x1d0fa0c, rho=0x1d0c494) at eval.c:1337
> #10 0x01099bb4 in Rf_eval (e=0x1d0f9f0, rho=0x1d0c494) at eval.c:425
> #11 0x0109bc60 in do_begin (call=0x1d0f5e4, op=0x180a2cc,
> args=0x1d0f9d4, rho=0x1d0c494) at eval.c:1101
> #12 0x01099bb4 in Rf_eval (e=0x1d0f5e4, rho=0x1d0c494) at eval.c:425
> #13 0x01099bb4 in Rf_eval (e=0x1d0f520, rho=0x1d0c494) at eval.c:425
> #14 0x0109bc60 in do_begin (call=0x1d10f18, op=0x180a2cc,
> args=0x1d0f504, rho=0x1d0c494) at eval.c:1101
> #15 0x01099bb4 in Rf_eval (e=0x1d10f18, rho=0x1d0c494) at eval.c:425
> #16 0x0109d0ac in Rf_applyClosure (call=0x1d1353c, op=0x1d10d58,
> arglist=0x1d0d2ec, rho=0x1d13830, suppliedenv=0x181d304) at eval.c:615
> #17 0x01099d94 in Rf_eval (e=0x1d1353c, rho=0x1d13830) at eval.c:456
> #18 0x0109b008 in Rf_DispatchOrEval (call=0x1d134cc, op=0x180b978,
> generic=0x11d74d0 "[", args=0x1d13504, rho=0x1d13830, ans=0xbfffa248,
> dropmissing=0, argsevald=0) at eval.c:1758
> #19 0x0115a828 in do_subset (call=0x1d134cc, op=0x180b978, args=0x0,
> rho=0x1d13830) at subset.c:527
> #20 0x01099bb4 in Rf_eval (e=0x1d134cc, rho=0x1d13830) at eval.c:425
> #21 0x01099a5c in Rf_eval (e=0x1d118a0, rho=0x1d1192c) at eval.c:402
> #22 0x0109ae04 in Rf_evalList (el=0x1b4f9dc, rho=0x1d1192c) at eval.c:
> 1417
> #23 0x010c9980 in do_internal (call=0x1b4f9dc, op=0x1,
> args=0x1b4fa14, env=0

Re: [Rd] Converting SEXP to primitive C types

2006-07-12 Thread Hin-Tak Leung
Michael Petrovich wrote:
> I'm new to R development, so this may be a trivial question.
> 
> In C, How do you convert a SEXP value returned by an R function to a  
> primitive C type (int, double, char, array, etc.)? I've tried using  
> the INTEGER(x), VECTOR_ELT(x,i), and similar functions found in /src/ 
> include/Rinternals.h, but doing so results in incorrect results or a  
> seg-fault.
> 
> For example, I modified /tests/Embedding/Rerror.c so that it tries to  
> print the value returned by the function defined in error.R:
> 
> val = Test_tryEval(e, &errorOccurred);
> printf("Returned: {%d}\n", VECTOR_ELT(val, 0) );

Prof Ripley had already pointed you to the "Writing R extensions" 
manual, which explains this stuff in more details, and also hinted
that most probably it is REALSXP instead of yours guesses. So I am just 
going to give a somewhat concrete example - you want to be
doing something like this instead:

val = Test_tryEval(e, &errorOccurred);

switch( TYPEOF(val) ) {
case REALSXP:
printf("Returned: {%f}\n", REAL(val)[0]);
break;
case INTSXP:
printf("Returned: {%d}\n", INTEGER(val)[0]);
break;
case STRSXP:
printf("Returned: {%s}\n", CHAR(STRING_ELT(val, 0)));
break;
default:
printf("Don't know what to do about type %d\n", TYPEOF(val));
}

> 
> Where error.R is contains:
> 
> foo <-
> function(x=3, y=6)
> {
>z <- x * y
>z
> }
> 
> But the output is just "0", not the correct "18". Any ideas?
> 
> Thanks for your help!
> 
> __
> 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] string-length limitations

2006-07-12 Thread jake wilson
Hi,

I'm attempting to "glm" a formula - something that's not caused problems in 
the past.  I've used formulas of the form

formula( "dependant-variable~independant-variables" )

where the independant variable string is of the form:

"indvar1+indvar2+...+indvarN"

Now, however, our independant variable strings are quite long (hundreds of 
variables) - R dies with an "input buffer overflow" error.  I've tried 
writing out the code to files and sourcing them, as well as building the 
strings incrementally in R, but these have not worked either.  I have come 
to believe there is a maximum length for char strings - some sort of 
fundamental limitation.  Is there such a max-length and, if so, is there a 
way I can work with long strings of the sort referenced above?

Thank you,
J. Wilson

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


Re: [Rd] string-length limitations

2006-07-12 Thread Thomas Lumley
On Wed, 12 Jul 2006, jake wilson wrote:
> I'm attempting to "glm" a formula - something that's not caused problems in
> the past.  I've used formulas of the form
>
>formula( "dependant-variable~independant-variables" )
>
> where the independant variable string is of the form:
>
>"indvar1+indvar2+...+indvarN"
>
> Now, however, our independant variable strings are quite long (hundreds of
> variables) - R dies with an "input buffer overflow" error.  I've tried
> writing out the code to files and sourcing them, as well as building the
> strings incrementally in R, but these have not worked either.  I have come
> to believe there is a maximum length for char strings - some sort of
> fundamental limitation.  Is there such a max-length and, if so, is there a
> way I can work with long strings of the sort referenced above?
>

How long are the strings, and where does the error occur (traceback()) 
will tell you where)?

With
fn <- function(n) 
formula(paste("y",paste("xxx",1:n,collapse="+",sep=""),sep="~"))

I can run terms(fn(500)) with no problems. This is a 15500 character 
string, and produces a terms object over a megabyte in size. This suggests 
that it isn't a string problem, unless you really want formulas larger 
than this.

-thomas

Thomas Lumley   Assoc. Professor, Biostatistics
[EMAIL PROTECTED]   University of Washington, Seattle

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


Re: [Rd] string-length limitations

2006-07-12 Thread Prof Brian Ripley
On Wed, 12 Jul 2006, jake wilson wrote:

> Hi,
> 
> I'm attempting to "glm" a formula - something that's not caused problems in 
> the past.  I've used formulas of the form
> 
> formula( "dependant-variable~independant-variables" )
> 
> where the independant variable string is of the form:
> 
> "indvar1+indvar2+...+indvarN"

Why the quotes?: I think that is your problem.

> Now, however, our independant variable strings are quite long (hundreds of 
> variables) - R dies with an "input buffer overflow" error.  

It is normal to use (y ~ ., data=mydata) to avoid such formulae.

>  I've tried writing out the code to files and sourcing them, as well as 
> building the strings incrementally in R, but these have not worked 
> either.  I have come to believe there is a maximum length for char 
> strings - some sort of fundamental limitation.  Is there such a 
> max-length and, if so, is there a way I can work with long strings of 
> the sort referenced above?

The limit is 2^31 -1, not relevant here.

Your message is coming from the parser, and suggests that it is trying to 
parse a piece of text longer than MAXELTSIZE bytes.  The latter depends on 
the platform (unstated: do see the posting guide) and is often 8196 bytes.  
So there is a limit on the length of quoted strings which can be input.

However, what is wrong with say

tmp <- paste(paste("indvar", 1:1000, sep=""), collapse="+")
tmp <- paste("y ~", tmp)
form <- eval(parse(text=tmp))

?

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
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


Re: [Rd] string-length limitations

2006-07-12 Thread jake wilson
Thank you - the proposed solution (eliminating quotes) worked.


>From: Prof Brian Ripley <[EMAIL PROTECTED]>
>To: jake wilson <[EMAIL PROTECTED]>
>CC: r-devel@r-project.org
>Subject: Re: [Rd] string-length limitations
>Date: Wed, 12 Jul 2006 15:38:22 +0100 (BST)
>
>On Wed, 12 Jul 2006, jake wilson wrote:
>
> > Hi,
> >
> > I'm attempting to "glm" a formula - something that's not caused problems 
>in
> > the past.  I've used formulas of the form
> >
> > formula( "dependant-variable~independant-variables" )
> >
> > where the independant variable string is of the form:
> >
> > "indvar1+indvar2+...+indvarN"
>
>Why the quotes?: I think that is your problem.
>
> > Now, however, our independant variable strings are quite long (hundreds 
>of
> > variables) - R dies with an "input buffer overflow" error.
>
>It is normal to use (y ~ ., data=mydata) to avoid such formulae.
>
> >  I've tried writing out the code to files and sourcing them, as well as
> > building the strings incrementally in R, but these have not worked
> > either.  I have come to believe there is a maximum length for char
> > strings - some sort of fundamental limitation.  Is there such a
> > max-length and, if so, is there a way I can work with long strings of
> > the sort referenced above?
>
>The limit is 2^31 -1, not relevant here.
>
>Your message is coming from the parser, and suggests that it is trying to
>parse a piece of text longer than MAXELTSIZE bytes.  The latter depends on
>the platform (unstated: do see the posting guide) and is often 8196 bytes.
>So there is a limit on the length of quoted strings which can be input.
>
>However, what is wrong with say
>
>tmp <- paste(paste("indvar", 1:1000, sep=""), collapse="+")
>tmp <- paste("y ~", tmp)
>form <- eval(parse(text=tmp))
>
>?
>
>--
>Brian D. Ripley,  [EMAIL PROTECTED]
>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


Re: [Rd] Call R function from Java

2006-07-12 Thread way4thesub

Hello,

I am currently attempting to use JRI to call data mining functions in R (ie
rpart, lda, etc). I am using Eclipse 3.1.1 and jre1.5.0_06 and jdk1.5.0_07.

I am unsure how to actually import JRI into eclipse. I've downloaded the
JGR, the rJava and the JRI. I've included the jri.jar file in my eclipse
project and eclipse recognized the classes and interfaces. However when I
went to execute the program it gave me an error about the correct libraries
not being there.

I therefore included the following code:
   System.load("C:\\Program Files\\R\\R-2.2.1\\bin\\R.dll");
   System.load("C:\\Program Files\\R\\R-2.2.1\\bin\\Rblas.dll");
   System.load("C:\\jri\\jri.dll");

(and the 3 files actually exist in those locations)

However, it turns out R.dll depends upon Rblas.dll and vice versa so I can
never actually get it to work without throwing a "UnsatisfiedLinkError."
What am I doing wrong?

I'm sorry this is such an easy question but with the lack of FAQ's and
examples of JRI, I'm forced to ask it.

Adam

-- 
View this message in context: 
http://www.nabble.com/Call-R-function-from-Java-tf1906302.html#a5301125
Sent from the R devel forum at Nabble.com.

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


Re: [Rd] Call R function from Java

2006-07-12 Thread Prof Brian Ripley
Please do study the posting guide and consult the maintainer (as it asked 
you to do) with basic information (such as your OS) and the exact messages 
you received.

As a guess: your PATH does not include the R DLLs and needs to?

On Wed, 12 Jul 2006, way4thesub wrote:

> 
> Hello,
> 
> I am currently attempting to use JRI to call data mining functions in R (ie
> rpart, lda, etc). I am using Eclipse 3.1.1 and jre1.5.0_06 and jdk1.5.0_07.
> 
> I am unsure how to actually import JRI into eclipse. I've downloaded the
> JGR, the rJava and the JRI. I've included the jri.jar file in my eclipse
> project and eclipse recognized the classes and interfaces. However when I
> went to execute the program it gave me an error about the correct libraries
> not being there.
> 
> I therefore included the following code:
>System.load("C:\\Program Files\\R\\R-2.2.1\\bin\\R.dll");
>System.load("C:\\Program Files\\R\\R-2.2.1\\bin\\Rblas.dll");  
>System.load("C:\\jri\\jri.dll");
> 
> (and the 3 files actually exist in those locations)
> 
> However, it turns out R.dll depends upon Rblas.dll and vice versa so I can
> never actually get it to work without throwing a "UnsatisfiedLinkError."
> What am I doing wrong?
> 
> I'm sorry this is such an easy question but with the lack of FAQ's and
> examples of JRI, I'm forced to ask it.
> 
> Adam
>   
> 

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
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