[R] ROracle SQL length limitation

Brown, Chris chris.brown at amd.com
Thu Nov 11 16:10:43 CET 2004


Hi All,

This question was brought up some time ago but I never saw a reply so I'd like to bring it up again. When using ROracle package (version 0.5-5), I am unable to run any queries that are greater than 4000 characters in length. If I do, I get the following message:

Error in oraPrepareStatement(con, statement, bind=NULL) :
	RS-DBI driver: (too long a statement -- it must has less than 4000 chars)

I realize this is not a "bug", but simply a predefined limit that has been set. Can this string limit be increased? Based on the only email I saw on this issue I edited RS-Oracle.h to be:

#define RS_ORA_MAX_STRING 8000
#define RS_ORA_STATEMENT_LEN 8000

Both of these values were previously set to 4000. However, this does not solve the problem and I am still seeing the same 4000 char limit message after header edit and recompile. Any ideas? Is this limit being read from DBI library directly?

Version info:
platform i686-pc-linux-gnu
arch     i686             
os       linux-gnu        
system   i686, linux-gnu  
status                    
major    1                
minor    9.1              
year     2004             
month    06               
day      21               
language R     

Thanks,
Chris



-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of r-help-request at stat.math.ethz.ch
Sent: Thursday, November 11, 2004 5:22 AM
To: r-help at stat.math.ethz.ch
Subject: R-help Digest, Vol 21, Issue 11

Send R-help mailing list submissions to
	r-help at stat.math.ethz.ch

To subscribe or unsubscribe via the World Wide Web, visit
	https://stat.ethz.ch/mailman/listinfo/r-help
or, via email, send a message with subject or body 'help' to
	r-help-request at stat.math.ethz.ch

You can reach the person managing the list at
	r-help-owner at stat.math.ethz.ch

When replying, please edit your Subject line so it is more specific
than "Re: Contents of R-help digest..."


Today's Topics:

   1. glm.nb (Ronaldo Reis Jr.)
   2. Re: R under Pocket PC (Peter Dalgaard)
   3. lattice: ordering the entries in a dotplot of a vector
      (Wolfram Fischer)
   4. Multiple stripcharts using "for loop" (Paul JH Drake)
   5. Basic Q on coercing factors in data frames to numeric
      (Robert Brown FM CEFAS)
   6. Re: R under Pocket PC (Barry Rowlingson)
   7. printing to stderr (Arne.Muller at aventis.com)
   8. Re: R under Pocket PC (Tim Cutts)
   9. "conditional duplicates"? (Christian Schulz)
  10. Re: printing to stderr (Prof Brian Ripley)
  11. Re: "conditional duplicates"? (Dimitris Rizopoulos)
  12. Re: Basic Q on coercing factors in data frames to numeric
      (Roger D. Peng)
  13. Re: "conditional duplicates"? (Christian Schulz)
  14. RE: Does something like partition.rpart() exist? (Andy Bunn)
  15. Re: R under Pocket PC (Peter Dalgaard)
  16. fSeries (CYRIL.CAILLAULT at FORTISINVESTMENTS.COM)
  17. Re: worked in R, but not in S-Plus (Thomas Lumley)
  18. fSeries (Vito Ricci)
  19. Re: lattice: ordering the entries in a dotplot of a vector
      (Deepayan Sarkar)
  20. Building MacOSX binary in Windows XP (Tomas Aragon)
  21. Re: Building MacOSX binary in Windows XP (Prof Brian Ripley)
  22. cubic spline/smoother with nlme (Suzette Blanchard)
  23. Re: cubic spline/smoother with nlme (Peter Dalgaard)
  24. RE: cubic spline/smoother with nlme (Pikounis, Bill)
  25. Re: R under Pocket PC (Tom Mulholland)
  26. substitute/paste question for using Greek in plot titles
      (Peter Dunn)
  27. polr probit versus stata oprobit   (Jean Eid)
  28. R with Sun Studio Fortran 95 compiler (Bizuet Cabrera Fernando)
  29. Re: substitute/paste question for using Greek in plot titles
      (Sundar Dorai-Raj)
  30. Re: polr probit versus stata oprobit   (Thomas Lumley)
  31. Re: polr probit versus stata oprobit   (Jean Eid)
  32. Re: substitute/paste question for using Greek in plot titles
      (Roger D. Peng)
  33. "<<-" assignment no long work in class methods (Gang Liang)
  34. Re: "<<-" assignment no long work in class methods
      (Witold Eryk Wolski)
  35. Re: R with Sun Studio Fortran 95 compiler (Prof Brian Ripley)
  36. Re: fSeries (Diethelm Wuertz)
  37. Re: fSeries (Diethelm Wuertz)
  38. RSPerl problem with testing (Alicia Amadoz)
  39. Re: RSPerl problem with testing (Prof Brian Ripley)
  40. smoothing techniques (dave wilton)
  41. Re: R works on Fedora Core 3 (Martyn Plummer)
  42. Re: R works on Fedora Core 3 (Gavin Simpson)
  43. RODBC & POSIX & Daylight Saving blues (Bernie McConnell)


----------------------------------------------------------------------

Message: 1
Date: Wed, 10 Nov 2004 08:59:49 -0200
From: "Ronaldo Reis Jr." <chrysopa at insecta.ufv.br>
Subject: [R] glm.nb
To: "R-Help" <r-help at stat.math.ethz.ch>
Message-ID: <200411100859.49819.chrysopa at insecta.ufv.br>
Content-Type: text/plain;  charset="iso-8859-1"

Hi,

I make some simulations with rnbinom and try to test with glm.nb.

But in some data set the glm.nb fail.

Look:

pop <- rnbinom(n=1000,size=1,mu=0.05)
> glm.nb(pop~1,maxit=1000)
Error in while ((it <- it + 1) < limit && abs(del) > eps) { : 
 missing value where TRUE/FALSE needed

look some pop charactetistics:
> summary(pop)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  0.000   0.000   0.000   0.052   0.000   2.000

> hist(pop,plot=F)
$breaks
 [1] 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0

$counts
 [1] 949   0   0   0  50   0   0   0   0   1

$intensities
 [1] 4.744999 0.000000 0.000000 0.000000 0.250000 0.000000 0.000000 0.000000
 [9] 0.000000 0.005000

$density
 [1] 4.744999 0.000000 0.000000 0.000000 0.250000 0.000000 0.000000 0.000000
 [9] 0.000000 0.005000

$mids
 [1] 0.1 0.3 0.5 0.7 0.9 1.1 1.3 1.5 1.7 1.9

My question is:

Why this error occour and how to solve this problem without increase the mu 
parameter in rnbinom?


Thanks fo all

Ronaldo

---
Your ignorance cramps my conversation.
--
|>   // | \\   [***********************************]
|   ( õ   õ )  [Ronaldo Reis Júnior                ]
|>      V      [UFV/DBA-Entomologia                ]
|    /     \   [36571-000 Viçosa - MG              ]
|>  /(.''`.)\  [Fone: 31-3899-2532                 ]
|  /(: :'  :)\ [chrysopa at insecta.ufv.br            ]
|>/ (`. `'` ) \[ICQ#: 5692561 | LinuxUser#: 205366 ]
|    ( `-  )   [***********************************]
|>>  _/   \_Powered by GNU/Debian Woody/Sarge



------------------------------

Message: 2
Date: 10 Nov 2004 12:03:36 +0100
From: Peter Dalgaard <p.dalgaard at biostat.ku.dk>
Subject: Re: [R] R under Pocket PC
To: "Stuart Leask" <stuart.leask at nottingham.ac.uk>
Cc: r-help at stat.math.ethz.ch
Message-ID: <x2d5ymj793.fsf at biostat.ku.dk>
Content-Type: text/plain; charset=us-ascii

"Stuart Leask" <stuart.leask at nottingham.ac.uk> writes:

> > One concern I recall from looking into this a while back (hopefully
> > not founded) was the issue with floating point handling on the ARMs
> > and similar PDA CPUs.
> >
> > This was relevant to the familiar/intimate linux distro's around 18-24
> > months ago, when I was considering an IPAQ or Zaurus to replace my old
> > but not dead yet palm.
> 
> Thanks to the excellent work of the R developers in keeping all the code
> quite standard, and some specific work by Simon Pickering (Bath University),
> I have had R working (with graphics) on my Sharp Zaurus for some time.
> Sadly, checking today his site is down, but binaries for the Zaurus are
> available.
> 
> There was a problem with NA handling that needed specifically addressing,
> and some missing fonts, but the fpu emulation worked fine. This was using
> X11, keypebble and VNC. It could _just about_ run in the standard RAM -
> although was a lot happier with extra memory. Most impressive, and well done
> Simon (and the R team).

Right. As I recall it, the FPU/NA issue was a case of configure
getting the byte-order wrong and not (as was believed for a while) a
problem with non-IEEE arithmetic.
 
> However, a note of caution - presumably due to the lack of a hardware fpu,
> and perhaps also the relatively slow access speed of SD ram, benchmarks on
> the zaurus ran anything up to (wait for it!) 100 times slower than a pentium
> of the same clock speed. This has sadly left R on my Zaurus largely idle, as
> in practice I found it just too slow to be usable.

Hmm. So you're probably limited to problems that require on the order
of tens of milliseconds FPU time on a normal machine. I suppose that
there are usages where this is feasible.

> I fear this problem could afflict any handheld implementation, until they
> start putting fpu's on these chips.

Yes. Now where are the video gamers when you need them?

> (PS. I have the same problem with a mini-ITX 'silent PC' - many of these
> low-power cpus (eg. Eden) lack hardware FPU. They run many office apps fine,
> but when I benchmarked with a stats program, I found it 50 times slower than
> a pentium of equivalent clock speed! I am advised that even those that do
> have hardware FPU eg. the Nehemiah chip are only 50-60% as fast as a
> pentium-class cpu of similar clock speed)

Hmm, the newer ones (Eden-N, Eden-ESP) claim "full-speed FPU". I've
been toying around with the idea of building a system around the
MythTV stuff to get a harddisk video recording, etc. Could be kind of
fun to run R on it with display to the TV (but could you control R
with the TV remote control?)

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907



------------------------------

Message: 3
Date: Wed, 10 Nov 2004 12:28:13 +0100
From: Wolfram Fischer <wolfram at fischer-zim.ch>
Subject: [R] lattice: ordering the entries in a dotplot of a vector
To: r-help at stat.math.ethz.ch
Message-ID: <20041110112813.GA4165 at s1x.local>
Content-Type: text/plain; charset=us-ascii

I tried:
    n <- 9
    x <- sample(n)
    names(x) <- LETTERS[1:n]
    dotplot( sort(x) )

The lines of the dotplot are not ordered according to the values of x
(but according to the names of x).

So I did:

    dfx <- data.frame( x=x, label=factor( names(x), names(x)[order(x)] ) )
    dotplot( label ~ x, data=dfx )

So I got what I wanted.

My question: Is there an easier solution for doing that?

Wolfram



------------------------------

Message: 4
Date: Wed, 10 Nov 2004 11:49:27 +0000
From: Paul JH Drake <p.drake at beatson.gla.ac.uk>
Subject: [R] Multiple stripcharts using "for loop"
To: R-help at stat.math.ethz.ch
Message-ID: <1100087367.12807.8.camel at G4.site>
Content-Type: text/plain

Sorry, I didn't post my system details:
SuSE Linux 9.1
R version 2.0.0
P4 Laptop, 512MB RAM

THanks for the reply. I'll see what I can do with the data.

Paul



------------------------------

Message: 5
Date: Wed, 10 Nov 2004 12:03:38 -0000
From: "Robert Brown FM CEFAS" <r.g.brown at cefas.co.uk>
Subject: [R] Basic Q on coercing factors in data frames to numeric
To: <r-help at stat.math.ethz.ch>
Message-ID:
	<3589BC4D64C84341AE0C258244F977A2B60B63 at expressa.corp.cefas.co.uk>
Content-Type: text/plain;	charset="iso-8859-1"

Hi there,

I'm running R 2.0.0 on Windows 95.  I'm trying to coerce a column of factors within a data frame to numeric.  This is not a problem with a vector, but I can't find a way to index a column within a data frame to achieve this. All the examples from 'An introduction to R', 'S-plus 6 programmers guide', etc, use simple vectors.  I'm sure I'm missing something obvious but I can't find a way to change a single column in data frame. Ive tried several approaches: here is one

> summary(test)
      age        yrclass       weight              year     
 1      :10   1992   :10   Min.   :0.005333   Min.   :1993  
 2      :10   1989   : 9   1st Qu.:0.221790   1st Qu.:1995  
 3      :10   1990   : 9   Median :0.413411   Median :1997  
 4      :10   1991   : 9   Mean   :0.420119   Mean   :1997  
 5      :10   1988   : 8   3rd Qu.:0.559819   3rd Qu.:2000  
 6      :10   1993   : 8   Max.   :1.189000   Max.   :2002  
 (Other):82   (Other):89                                    
> contents(test)

Data frame:test 142 observations and 4 variables    Maximum # NAs:0

        Levels Storage
age         23 integer
yrclass     28 integer
weight          double
year            double

+--------+---------------------------------------------------------------------+
|Variable|Levels                                                               |
+--------+---------------------------------------------------------------------+
| age    |0,1,10,11,12,13,14,15,16,18,19,2,20,21,24,25,3,4,5,6,7,8,9           |
+--------+---------------------------------------------------------------------+
| yrclass|1969,1974,1975,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988|
|        |1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002|
+--------+---------------------------------------------------------------------+
> is(test$yrclass,"factor")
[1] TRUE
> is(test$yrclass,"numeric")
[1] FALSE
> as(test[,2],"numeric")
  [1]  1  1  2  3  3  4  5  6  6  6  7  7  8  8  8  8  9  9  9  9 10 10 10 10 10
 [26] 10 10 11 11 11 11 11 12 12 12 12 12 12 12 13 13 13 13 13 13 13 14 14 14 14
 [51] 14 14 14 14 15 15 15 15 15 15 15 15 15 16 16 16 16 16 16 16 16 16 17 17 17
 [76] 17 17 17 17 17 17 18 18 18 18 18 18 18 18 18 18 19 19 19 19 19 19 19 19 20
[101] 20 20 20 20 20 20 20 21 21 21 21 21 21 21 21 22 22 22 22 22 22 22 23 23 23
[126] 23 23 23 24 24 24 24 24 25 25 25 25 26 26 27 27 28
> is(test$yrclass,"numeric")
[1] FALSE


Regards,

Robert Brown



------------------------------

Message: 6
Date: Wed, 10 Nov 2004 12:11:51 +0000
From: Barry Rowlingson <B.Rowlingson at lancaster.ac.uk>
Subject: Re: [R] R under Pocket PC
To: r-help at stat.math.ethz.ch
Message-ID: <41920587.6000103 at lancaster.ac.uk>
Content-Type: text/plain; charset=us-ascii; format=flowed


> Could be kind of
> fun to run R on it with display to the TV (but could you control R
> with the TV remote control?)

  Peter,

    I'm sure everyone on this list feels you work hard enough on R as it 
is, dont let it invade your living room as well!

Baz



------------------------------

Message: 7
Date: Wed, 10 Nov 2004 13:21:48 +0100
From: <Arne.Muller at aventis.com>
Subject: [R] printing to stderr
To: <r-help at stat.math.ethz.ch>
Message-ID:
	<C80ECAFA2ACC1B45BE45D133ED660ADE010BF296 at crbsmxsusr04.pharma.aventis.com>
	
Content-Type: text/plain;	charset="iso-8859-1"

Hello,

is it possible to configure the print function to print to stderr?

	kind regards,

	Arne



------------------------------

Message: 8
Date: Wed, 10 Nov 2004 12:27:05 +0000
From: Tim Cutts <tjrc at sanger.ac.uk>
Subject: Re: [R] R under Pocket PC
To: Peter Dalgaard <p.dalgaard at biostat.ku.dk>
Cc: Lars Strand <lars.strand at skogforsk.no>,	Prof Brian Ripley
	<ripley at stats.ox.ac.uk>, R-help at stat.math.ethz.ch
Message-ID: <D4D5A05A-3313-11D9-AF52-000A95B2B140 at sanger.ac.uk>
Content-Type: text/plain; charset=US-ASCII; format=flowed


On 9 Nov 2004, at 5:14 pm, Peter Dalgaard wrote:
>>> PalmOS would probably be right out.  :-)
>>
>> I think you are belittling the work done to get R running on as wide a
>> range of platforms as it does.
>
> ?
>
> I only saw a bit of excessive pessimism in that remark.

Yes, no disrespect was intended at all.  Porting to PalmOS is quite a 
different kettle of fish compared to porting between (say) Windows and 
UNIX, because the OS doesn't have a libc; if you use almost any 
standard C library function your binary becomes a huge (because it 
needs to be statically linked with the C library that comes with your 
cross compiler).  A true PalmOS port of any piece of software often 
requires a lot of work to replace standard C library calls with the 
equivalents built into the machine.  Someone may have created some sort 
of wrapper C library, but when I last wrote any software for Palm 
devices, such a thing did not exist.

Admittedly, that was about two years ago, when I wrote some stuff for 
PalmOS 4.

Tim

-- 
Dr Tim Cutts
Informatics Systems Group, Wellcome Trust Sanger Institute
GPG: 1024D/E3134233 FE3D 6C73 BBD6 726A A3F5  860B 3CDD 3F56 E313 4233



------------------------------

Message: 9
Date: Wed, 10 Nov 2004 13:52:29 +0100
From: Christian Schulz <ozric at web.de>
Subject: [R] "conditional duplicates"?
To: r-help at stat.math.ethz.ch
Message-ID: <41920F0D.9030900 at web.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi,

i would like check a repeated measurement dataset, whether
cases (which (id) could be more than one time included and not all same 
times included.)
have more than one times the same SMONTH!?

#This pseudo code didn't work with a for loop, because the [i+1] isn't 
known.
How i could refer to [i+1] ?

if(ID[i] == ID[i+1] & SMONTH[i] !=[i+1])  {res[i] <- 0 }
if(ID[i] == ID[i+1] & SMONTH[i] == [i+1]) {res[i] <- 1 }
 
many thanks,
christian



------------------------------

Message: 10
Date: Wed, 10 Nov 2004 13:06:51 +0000 (GMT)
From: Prof Brian Ripley <ripley at stats.ox.ac.uk>
Subject: Re: [R] printing to stderr
To: Arne.Muller at aventis.com
Cc: r-help at stat.math.ethz.ch
Message-ID: <Pine.LNX.4.44.0411101304390.18087-100000 at gannet.stats>
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Wed, 10 Nov 2004 Arne.Muller at aventis.com wrote:

> is it possible to configure the print function to print to stderr?

No, but where standard output goes is controlled by sink(), so you can 
achieve the same effect.  R internally has no idea what output comes from 
print() (which is not just one function but hundreds of methods).

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
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, UK                Fax:  +44 1865 272595



------------------------------

Message: 11
Date: Wed, 10 Nov 2004 14:09:01 +0100
From: "Dimitris Rizopoulos" <dimitris.rizopoulos at med.kuleuven.ac.be>
Subject: Re: [R] "conditional duplicates"?
To: "Christian Schulz" <ozric at web.de>
Cc: r-help at stat.math.ethz.ch
Message-ID: <003f01c4c726$7230ec30$0540210a at www.domain>
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
	reply-type=response

Hi Christian,

may be this is helpful:

dat <- data.frame(id=rep(1:4, each=5), smonth=sample(1:5, 20, TRUE))
dat$duplicated <- unlist(tapply(dat$smonth, dat$id, duplicated))
dat

Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/396887
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
     http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm


----- Original Message ----- 
From: "Christian Schulz" <ozric at web.de>
To: <r-help at stat.math.ethz.ch>
Sent: Wednesday, November 10, 2004 1:52 PM
Subject: [R] "conditional duplicates"?


> Hi,
>
> i would like check a repeated measurement dataset, whether
> cases (which (id) could be more than one time included and not all 
> same times included.)
> have more than one times the same SMONTH!?
>
> #This pseudo code didn't work with a for loop, because the [i+1] 
> isn't known.
> How i could refer to [i+1] ?
>
> if(ID[i] == ID[i+1] & SMONTH[i] !=[i+1])  {res[i] <- 0 }
> if(ID[i] == ID[i+1] & SMONTH[i] == [i+1]) {res[i] <- 1 }
>
> many thanks,
> christian
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>



------------------------------

Message: 12
Date: Wed, 10 Nov 2004 08:20:27 -0500
From: "Roger D. Peng" <rpeng at jhsph.edu>
Subject: Re: [R] Basic Q on coercing factors in data frames to numeric
To: Robert Brown FM CEFAS <r.g.brown at cefas.co.uk>
Cc: r-help at stat.math.ethz.ch
Message-ID: <4192159B.4050602 at jhsph.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

I believe this is a FAQ.  See 
http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-convert-factors-to-numeric_003f

-roger

Robert Brown FM CEFAS wrote:
> Hi there,
> 
> I'm running R 2.0.0 on Windows 95.  I'm trying to coerce a column of factors within a data frame to numeric.  This is not a problem with a vector, but I can't find a way to index a column within a data frame to achieve this. All the examples from 'An introduction to R', 'S-plus 6 programmers guide', etc, use simple vectors.  I'm sure I'm missing something obvious but I can't find a way to change a single column in data frame. Ive tried several approaches: here is one
> 
> 
>>summary(test)
> 
>       age        yrclass       weight              year     
>  1      :10   1992   :10   Min.   :0.005333   Min.   :1993  
>  2      :10   1989   : 9   1st Qu.:0.221790   1st Qu.:1995  
>  3      :10   1990   : 9   Median :0.413411   Median :1997  
>  4      :10   1991   : 9   Mean   :0.420119   Mean   :1997  
>  5      :10   1988   : 8   3rd Qu.:0.559819   3rd Qu.:2000  
>  6      :10   1993   : 8   Max.   :1.189000   Max.   :2002  
>  (Other):82   (Other):89                                    
> 
>>contents(test)
> 
> 
> Data frame:test 142 observations and 4 variables    Maximum # NAs:0
> 
>         Levels Storage
> age         23 integer
> yrclass     28 integer
> weight          double
> year            double
> 
> +--------+---------------------------------------------------------------------+
> |Variable|Levels                                                               |
> +--------+---------------------------------------------------------------------+
> | age    |0,1,10,11,12,13,14,15,16,18,19,2,20,21,24,25,3,4,5,6,7,8,9           |
> +--------+---------------------------------------------------------------------+
> | yrclass|1969,1974,1975,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988|
> |        |1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002|
> +--------+---------------------------------------------------------------------+
> 
>>is(test$yrclass,"factor")
> 
> [1] TRUE
> 
>>is(test$yrclass,"numeric")
> 
> [1] FALSE
> 
>>as(test[,2],"numeric")
> 
>   [1]  1  1  2  3  3  4  5  6  6  6  7  7  8  8  8  8  9  9  9  9 10 10 10 10 10
>  [26] 10 10 11 11 11 11 11 12 12 12 12 12 12 12 13 13 13 13 13 13 13 14 14 14 14
>  [51] 14 14 14 14 15 15 15 15 15 15 15 15 15 16 16 16 16 16 16 16 16 16 17 17 17
>  [76] 17 17 17 17 17 17 18 18 18 18 18 18 18 18 18 18 19 19 19 19 19 19 19 19 20
> [101] 20 20 20 20 20 20 20 21 21 21 21 21 21 21 21 22 22 22 22 22 22 22 23 23 23
> [126] 23 23 23 24 24 24 24 24 25 25 25 25 26 26 27 27 28
> 
>>is(test$yrclass,"numeric")
> 
> [1] FALSE
> 
> 
> Regards,
> 
> Robert Brown
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 

-- 
Roger D. Peng
http://www.biostat.jhsph.edu/~rpeng/



------------------------------

Message: 13
Date: Wed, 10 Nov 2004 14:27:07 +0100
From: Christian Schulz <ozric at web.de>
Subject: Re: [R] "conditional duplicates"?
To: Dimitris Rizopoulos <dimitris.rizopoulos at med.kuleuven.ac.be>
Cc: r-help at stat.math.ethz.ch
Message-ID: <4192172B.4010800 at web.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Many Thanks!

Dimitris Rizopoulos wrote:

> Hi Christian,
>
> may be this is helpful:
>
> dat <- data.frame(id=rep(1:4, each=5), smonth=sample(1:5, 20, TRUE))
> dat$duplicated <- unlist(tapply(dat$smonth, dat$id, duplicated))
> dat
>
> Best,
> Dimitris
>
> ----
> Dimitris Rizopoulos
> Ph.D. Student
> Biostatistical Centre
> School of Public Health
> Catholic University of Leuven
>
> Address: Kapucijnenvoer 35, Leuven, Belgium
> Tel: +32/16/396887
> Fax: +32/16/337015
> Web: http://www.med.kuleuven.ac.be/biostat/
>     http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm
>
>
> ----- Original Message ----- From: "Christian Schulz" <ozric at web.de>
> To: <r-help at stat.math.ethz.ch>
> Sent: Wednesday, November 10, 2004 1:52 PM
> Subject: [R] "conditional duplicates"?
>
>
>> Hi,
>>
>> i would like check a repeated measurement dataset, whether
>> cases (which (id) could be more than one time included and not all 
>> same times included.)
>> have more than one times the same SMONTH!?
>>
>> #This pseudo code didn't work with a for loop, because the [i+1] 
>> isn't known.
>> How i could refer to [i+1] ?
>>
>> if(ID[i] == ID[i+1] & SMONTH[i] !=[i+1])  {res[i] <- 0 }
>> if(ID[i] == ID[i+1] & SMONTH[i] == [i+1]) {res[i] <- 1 }
>>
>> many thanks,
>> christian
>>
>> ______________________________________________
>> R-help at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide! 
>> http://www.R-project.org/posting-guide.html
>>
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>



------------------------------

Message: 14
Date: Wed, 10 Nov 2004 09:39:09 -0500
From: "Andy Bunn" <abunn at whrc.org>
Subject: RE: [R] Does something like partition.rpart() exist?
To: "Simone Vantini" <vantini at mate.polimi.it>,
	<R-help at stat.math.ethz.ch>
Message-ID: <NEBBIPHDAMMOKDKPOFFIKEOGCLAA.abunn at whrc.org>
Content-Type: text/plain;	charset="iso-8859-1"

I might well be wrong, but I don't think there is. I went about rewriting
partition.tree for rpart once but stopped after I realized that it was much
easier to add lines and segments to plots by hand using the coordinates from
the rpart object (I then added a third predictor to my dataset making the
whole process pointless anyways.) Looking at the code for partition.tree and
its embedded function ptXlines gives you hints how to extract the relevant
bits of the tree to add to a plot.

I assume that you've seen this thread?

http://www.r-project.org/nocvs/mail/r-help/2002/0142.html

Sorry not to have been more help.

-Andy


> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Simone Vantini
> Sent: Wednesday, November 10, 2004 5:27 AM
> To: R-help at stat.math.ethz.ch
> Subject: [R] Does something like partition.rpart() exist?
>
>
> I'd like to create a bidimensional presentation of a classification tree
> built using the rpart() function. I've seen that a partition.tree()
> function exists for the tree() function. Does a similar function  exist
> for the rpart() function?
> Thanks a lot Simone Vantini
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>



------------------------------

Message: 15
Date: 10 Nov 2004 16:36:04 +0100
From: Peter Dalgaard <p.dalgaard at biostat.ku.dk>
Subject: Re: [R] R under Pocket PC
To: Barry Rowlingson <B.Rowlingson at lancaster.ac.uk>
Cc: r-help at stat.math.ethz.ch
Message-ID: <x2zn1piumz.fsf at biostat.ku.dk>
Content-Type: text/plain; charset=us-ascii

Barry Rowlingson <B.Rowlingson at lancaster.ac.uk> writes:

>     I'm sure everyone on this list feels you work hard enough on R as
> it is, dont let it invade your living room as well!

Too late. Laptop + WiFi + ADSL did that a while back.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907



------------------------------

Message: 16
Date: Wed, 10 Nov 2004 16:38:05 +0100
From: <CYRIL.CAILLAULT at FORTISINVESTMENTS.COM>
Subject: [R] fSeries
To: "' (r-help at stat.math.ethz.ch)'" <r-help at stat.math.ethz.ch>
Message-ID:
	<E66B5035E7D16C4B89028BAE9AC268A50403644B at I04MB144.fr.fimgroup>
Content-Type: text/plain

Good morning everyone,

I use for the first time the package fSeries and i try to run the example
given by Diethelm Würtz. But when i run its example which is the following 
#
# Example: 
#	Model a GARCH time series process 
#
# Description:
#	PART I: Estimate GARCH models of the following type ARCH(2) 
#     and GARCH(1,1) with normal conditional distribution functions.
#   PART II: Simulate GARCH models of the following type, ARCH(2) 
#     and GARCH(1,1),
#	with normal conditional distribution functions.
#
# Author:
#	(C) 2002, Diethelm Wuertz, GPL
#


############################################################################
####
# PART I: Estimation:

	# Settings:
	set.seed(547)
    # Bollerslev's GARCH(1,1) with normal innovations:
	model = list(omega = 1e-6, alpha = 0.1, beta = 0.8, mu = 0)
	x = garchSim(model, n = 1000)
	fit = garchFit(as.numeric(x), order = c(1, 1))
	print(fit)
	# Summary and Diagnostic Analysis:
	summary(fit)
	# Plot Results:
	par(mfrow = c(2, 2))
	plot(fit)
	###

Results of the estimations are false.

Call:
garchFit(x = as.numeric(x), order = c(1, 1))

Coefficient(s):
    omega         a1         b1  
8.564e-07  5.000e-02  5.000e-02  

To compare with : omega = 1e-6, alpha = 0.1, beta = 0.8.

Do you have some information about this?
Can I give some initials values to start the estimations?
Can I use different innovation process like student-t and GED

Thanks for your answers

Cyril 





	[[alternative HTML version deleted]]



------------------------------

Message: 17
Date: Wed, 10 Nov 2004 07:52:05 -0800 (PST)
From: Thomas Lumley <tlumley at u.washington.edu>
Subject: Re: [R] worked in R, but not in S-Plus
To: array chip <arrayprofile at yahoo.com>
Cc: r-help at stat.math.ethz.ch
Message-ID:
	<Pine.A41.4.61b.0411100748310.162604 at homer04.u.washington.edu>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

On Tue, 9 Nov 2004, array chip wrote:

> Hi,
>
> I wrote a function that worked well in R, but not in
> S-Plus, can anyone suggest a solution?
>

If you change the argument of the function from x to ... it will give
  Error in eval(expr, envir, enclos) : Object "x" not found
which is almost compatible with what it does in S-PLUS.

If you want advice on how to change the behaviour in S-PLUS, this is the 
wrong list.

>> f.coxph.zph<-function(x)
> {
> 	cox.fit <- coxph(Surv(time.cox, status.cox) ~ x,
> na.action = na.exclude, method = "breslow")
> 	fit.zph<-cox.zph(cox.fit,transform='log')
> 	fit.zph$table[,3]
> }


 	-thomas



------------------------------

Message: 18
Date: Wed, 10 Nov 2004 17:18:17 +0100 (CET)
From: Vito Ricci <vito_ricci at yahoo.com>
Subject: [R] fSeries
To: r-help at stat.math.ethz.ch
Cc: CYRIL.CAILLAULT at FORTISINVESTMENTS.COM
Message-ID: <20041110161817.82969.qmail at web41215.mail.yahoo.com>
Content-Type: text/plain; charset=iso-8859-1

Hi,

see ? garch in tseries package.

library(tseries)
> garch(x)

 ***** ESTIMATION WITH ANALYTICAL GRADIENT ***** 


Warning: singular information

Call:
garch(x = x)

Coefficient(s):
       a0         a1         b1  
8.564e-07  5.000e-02  5.000e-02  

Best
Vito


You wrote:

Good morning everyone,

I use for the first time the package fSeries and i try
to run the example
given by Diethelm Würtz. But when i run its example
which is the following 
#
# Example: 
#	Model a GARCH time series process 
#
# Description:
#	PART I: Estimate GARCH models of the following type
ARCH(2) 
#     and GARCH(1,1) with normal conditional
distribution functions.
#   PART II: Simulate GARCH models of the following
type, ARCH(2) 
#     and GARCH(1,1),
#	with normal conditional distribution functions.
#
# Author:
#	(C) 2002, Diethelm Wuertz, GPL
#


############################################################################
####
# PART I: Estimation:

	# Settings:
	set.seed(547)
    # Bollerslev's GARCH(1,1) with normal innovations:
	model = list(omega = 1e-6, alpha = 0.1, beta = 0.8,
mu = 0)
	x = garchSim(model, n = 1000)
	fit = garchFit(as.numeric(x), order = c(1, 1))
	print(fit)
	# Summary and Diagnostic Analysis:
	summary(fit)
	# Plot Results:
	par(mfrow = c(2, 2))
	plot(fit)
	###

Results of the estimations are false.

Call:
garchFit(x = as.numeric(x), order = c(1, 1))

Coefficient(s):
    omega         a1         b1  
8.564e-07  5.000e-02  5.000e-02  

To compare with : omega = 1e-6, alpha = 0.1, beta =
0.8.

Do you have some information about this?
Can I give some initials values to start the
estimations?
Can I use different innovation process like student-t
and GED

Thanks for your answers

Cyril 







=====
Diventare costruttori di soluzioni
Became solutions' constructors

"The business of the statistician is to catalyze 
the scientific learning process."  
George E. P. Box


Visitate il portale http://www.modugno.it/
e in particolare la sezione su Palese http://www.modugno.it/archivio/cat_palese.shtml



------------------------------

Message: 19
Date: Wed, 10 Nov 2004 10:47:28 -0600
From: Deepayan Sarkar <deepayan at stat.wisc.edu>
Subject: Re: [R] lattice: ordering the entries in a dotplot of a
	vector
To: r-help at stat.math.ethz.ch
Cc: Wolfram Fischer <wolfram at fischer-zim.ch>
Message-ID: <200411101047.28801.deepayan at stat.wisc.edu>
Content-Type: text/plain;  charset="iso-8859-1"

On Wednesday 10 November 2004 05:28, Wolfram Fischer wrote:
> I tried:
>     n <- 9
>     x <- sample(n)
>     names(x) <- LETTERS[1:n]
>     dotplot( sort(x) )
>
> The lines of the dotplot are not ordered according to the values of x
> (but according to the names of x).
>
> So I did:
>
>     dfx <- data.frame( x=x, label=factor( names(x),
> names(x)[order(x)] ) ) dotplot( label ~ x, data=dfx )
>
> So I got what I wanted.
>
> My question: Is there an easier solution for doing that?

It should have been the default behaviour (according to S-PLUS). The 
next release should fix this.

Deepayan



------------------------------

Message: 20
Date: Wed, 10 Nov 2004 09:40:21 -0800 (PST)
From: Tomas Aragon <aragon at berkeley.edu>
Subject: [R] Building MacOSX binary in Windows XP
To: r-help at stat.math.ethz.ch
Message-ID: <20041110174021.26501.qmail at web80104.mail.yahoo.com>
Content-Type: text/plain; charset=us-ascii

Under Windows XP, I am able to build R package archived as source
(.tar.gz) and Windows binary (.zip). Can I create MaxOSX archive file
(.tgz) in Windows XP?

Thanks,
Tomas

====
Tomas Aragon
http://www.epitools.net



------------------------------

Message: 21
Date: Wed, 10 Nov 2004 18:09:36 +0000 (GMT)
From: Prof Brian Ripley <ripley at stats.ox.ac.uk>
Subject: Re: [R] Building MacOSX binary in Windows XP
To: Tomas Aragon <aragon at berkeley.edu>
Cc: r-help at stat.math.ethz.ch
Message-ID: <Pine.LNX.4.44.0411101807020.30809-100000 at gannet.stats>
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Wed, 10 Nov 2004, Tomas Aragon wrote:

> Under Windows XP, I am able to build R package archived as source
> (.tar.gz) and Windows binary (.zip). Can I create MaxOSX archive file
> (.tgz) in Windows XP?

If you mean a .tgz containing a binary MacOSX version of the package, not 
without a cross-compiler (which I very much doubt you have).

You can certainly create .tgz files, but the it's the contents that 
matter.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
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, UK                Fax:  +44 1865 272595



------------------------------

Message: 22
Date: Wed, 10 Nov 2004 16:08:05 -0500 (EST)
From: Suzette Blanchard <suzette at sdac.harvard.edu>
Subject: [R] cubic spline/smoother with nlme
To: r-help at stat.math.ethz.ch
Message-ID:
	<Pine.GSO.4.40.0411101558200.17683-100000 at sdac.harvard.edu>
Content-Type: TEXT/PLAIN; charset=US-ASCII


Greetings,  I would like to use a cubic spline
or smoother to model the fixed effects within
nlme.  So far the only smoother I have been able
to get to run successfully in nlme is smooth().

I tried smooth.spline:
   fixed=list(lKa~1,lCL~smooth.spline(BSA, df=3))
   the error I got was the following.
   Error in model.frame(formula, rownames, variables, varnames, extras,
   extranames,  :  invalid variable type

Can anyone suggest a cubic spline that would work within
this context?

Thank you for any help you can send,
Suzette


=================================
Suzette Blanchard, Ph.D.
UCSD-PPRU



------------------------------

Message: 23
Date: 10 Nov 2004 22:53:58 +0100
From: Peter Dalgaard <p.dalgaard at biostat.ku.dk>
Subject: Re: [R] cubic spline/smoother with nlme
To: Suzette Blanchard <suzette at sdac.harvard.edu>
Cc: r-help at stat.math.ethz.ch
Message-ID: <x2fz3h9xqh.fsf at biostat.ku.dk>
Content-Type: text/plain; charset=us-ascii

Suzette Blanchard <suzette at sdac.harvard.edu> writes:

> Greetings,  I would like to use a cubic spline
> or smoother to model the fixed effects within
> nlme.  So far the only smoother I have been able
> to get to run successfully in nlme is smooth().
> 
> I tried smooth.spline:
>    fixed=list(lKa~1,lCL~smooth.spline(BSA, df=3))
>    the error I got was the following.
>    Error in model.frame(formula, rownames, variables, varnames, extras,
>    extranames,  :  invalid variable type
> 
> Can anyone suggest a cubic spline that would work within
> this context?

The fixed-knots ones (ns(), bs()) should work (and did so in at least
one case a couple of years ago...). These are linear, so lme() is used
rather than nlme(), unless of course you have other parts that need to
be modeled nonlinearly.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907



------------------------------

Message: 24
Date: Wed, 10 Nov 2004 17:29:28 -0500
From: "Pikounis, Bill" <v_bill_pikounis at merck.com>
Subject: RE: [R] cubic spline/smoother with nlme
To: "Suzette Blanchard" <suzette at sdac.harvard.edu>
Cc: r-help at stat.math.ethz.ch
Message-ID:
	<CFBD404F5E0C9547B4E10B7BDC3DFA2F0B16072D at usrymx18.merck.com>
Content-Type: text/plain

Suzette,
In addition to Professor Daalgard's suggestions of ns() and bs(), you could
also try out rcs() from Frank Harrell Design package (you may need his Hmisc
package as well). This function helps to fit natural (restricted cubic
splines), and have been very useful for me in practice to use in tandem with
lme() in modeling longitudinal data.

Hope that helps,
Bill

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Peter Dalgaard
> Sent: Wednesday, November 10, 2004 4:54 PM
> To: Suzette Blanchard
> Cc: r-help at stat.math.ethz.ch
> Subject: Re: [R] cubic spline/smoother with nlme
> 
> 
> Suzette Blanchard <suzette at sdac.harvard.edu> writes:
> 
> > Greetings,  I would like to use a cubic spline
> > or smoother to model the fixed effects within
> > nlme.  So far the only smoother I have been able
> > to get to run successfully in nlme is smooth().
> > 
> > I tried smooth.spline:
> >    fixed=list(lKa~1,lCL~smooth.spline(BSA, df=3))
> >    the error I got was the following.
> >    Error in model.frame(formula, rownames, variables, 
> varnames, extras,
> >    extranames,  :  invalid variable type
> > 
> > Can anyone suggest a cubic spline that would work within
> > this context?
> 
> The fixed-knots ones (ns(), bs()) should work (and did so in at least
> one case a couple of years ago...). These are linear, so lme() is used
> rather than nlme(), unless of course you have other parts that need to
> be modeled nonlinearly.
> 
> -- 
>    O__  ---- Peter Dalgaard             Blegdamsvej 3  
>   c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
>  (*) \(*) -- University of Copenhagen   Denmark      Ph: 
> (+45) 35327918
> ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: 
> (+45) 35327907
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
>



------------------------------

Message: 25
Date: Thu, 11 Nov 2004 07:55:17 +0800
From: Tom Mulholland <tmulholland at bigpond.com>
Subject: Re: [R] R under Pocket PC
To: r-help at stat.math.ethz.ch
Message-ID: <4192AA65.7090000 at bigpond.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

What is really scary, is the thought that in some housholds this would 
be an improvement. Instead of the family being closeted away in their 
various rooms playing with their computer, they could all be sitting 
together, while at the same time ignoring each other, but occassionally 
engaging in royal (as in "The Royals") interaction and the odd cuppa.

For those not familiar with the TV series "The Royals" its a chunk of 
domesticity that has to be seen to be appreciated ( or disgusted 
depending upon your view of life.)

Tom Mulholland


Barry Rowlingson wrote:
> 
>> Could be kind of
>> fun to run R on it with display to the TV (but could you control R
>> with the TV remote control?)
> 
> 
>  Peter,
> 
>    I'm sure everyone on this list feels you work hard enough on R as it 
> is, dont let it invade your living room as well!
> 
> Baz
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>



------------------------------

Message: 26
Date: Thu, 11 Nov 2004 10:25:27 +1000
From: Peter Dunn <dunn at usq.edu.au>
Subject: [R] substitute/paste question for using Greek in plot titles
To: R-help mailing list <R-help at stat.math.ethz.ch>
Message-ID: <4192B177.5020109 at usq.edu.au>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi all

I am having troubles making sense of why code (1)
below fails but code (2) below works.

Code (1):

 > phi.1 <- 1
 > plot(0 ~ 0,
+ main=substitute(paste("A vaue for ",phi," = ",phival), 
list(phival=phi.1)) )

Error in paste("The two deviances for ", phi, " = ", 2) :
         Object "phi" not found

But this works:

Code (2):
 > plot(0,0,
+ main=substitute(paste("A value for ",phi," = ",phival), 
list(phival=phi.1)) )
 >

It appears that if the plot command takes the formula style entry,
the substitue/paste fails.

Is this documented as a feature (I couldn't find it if that is the
case), or is it a bug?  If it is a feature, it is a subtle difference
between (1) and (2) that has potential to be quite frustrating!

Perhaps I should just upgrade to version 2.0.0, though I can't see
anything in the Release Notes that might cause this.

Thanks.

P.

 > version
          _
platform i686-pc-linux-gnu
arch     i686
os       linux-gnu
system   i686, linux-gnu
status
major    1
minor    9.1
year     2004
month    06
day      21
language R




-- 
Dr Peter Dunn          (USQ CRICOS No. 00244B)
   Web:    http://www.sci.usq.edu.au/staff/dunn
   Email:  dunn @ usq.edu.au
Opinions expressed are mine, not those of USQ.  Obviously...



------------------------------

Message: 27
Date: Wed, 10 Nov 2004 19:46:21 -0500
From: Jean Eid <jeaneid at chass.utoronto.ca>
Subject: [R] polr probit versus stata oprobit  
To: r-help at stat.math.ethz.ch
Message-ID:
	<Pine.SGI.4.40.0411101930330.52337307-100000 at origin.chass.utoronto.ca>
Content-Type: TEXT/PLAIN; charset=US-ASCII

Dear All,
I have been struggling to understand why for the housing data in MASS
library R and stata give coef. estimates that are really different. I also
tried to come up with many many examples myself (see below, of course I
did not have the set.seed command included) and all of my
`random' examples seem to give verry similar output. For the housing data,
I have changed the data into numeric vectors instead of factors/ordered
factors. I did so to try and get the same results as in STATA and to have
the housing example as close as possible to the one I constructed.

I run a debian sid, kernel 2.4, R 2.0.0, and STATA version 8.2, MASS
version  7.2-8.


here's the example ( I assume that you have STATA installed and can run in
batch mode, if not the output is also given below)

library(MASS)
library(foreign)
set.seed(100)
X <- rnorm(1000)
X1 <- rnorm(1000)
X2 <- rnorm(1000)
X <- X +X1+X2
XX <- X<=quantile(X, .25)
XX[X>quantile(X, .25) & X<=quantile(X, .50)] <- 2
XX[X>quantile(X, .5) & X<=quantile(X, .75)] <- 3
XX[X>quantile(X, .75)] <- 4
temp <- data.frame(XX=XX, X1=X1, X2=X2, X=X)
summary(polr(factor(XX)~X1 +X2, data=temp, method="probit"))
write.dta(temp, "temp.dta")
####################################
#Stata stuff
####################################
cat("use temp.dta\n oprobit XX X1 X2\n", file="temp.ado")
system("stata -b do temp.ado&")
system("cat temp.log")


#
##### here's R's output
#############################
Re-fitting to get Hessian

Call:
polr(formula = factor(XX) ~ X1 + X2, data = temp, method = "probit")

Coefficients:
       Value Std. Error  t value
X1 0.9891735 0.04749225 20.82811
X2 0.9400804 0.04527653 20.76309

Intercepts:
    Value    Std. Error t value
1|2  -1.1411   0.0572   -19.9613
2|3  -0.0372   0.0486    -0.7656
3|4   1.1101   0.0579    19.1865

Residual Deviance: 1969.734
AIC: 1979.734


##############################################
#and here  Stata's output
##############################################

Ordered probit estimates                          Number of obs   =
1000
                                                  LR chi2(2)      =
802.86
                                                  Prob > chi2     =
0.0000
Log likelihood = -984.86675                       Pseudo R2       =
0.2896

------------------------------------------------------------------------------
          XX |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          X1 |   .9891651   .0474922    20.83   0.000     .8960822    1.082248
          X2 |     .94007   .0452765    20.76   0.000     .8513298     1.02881
-------------+----------------------------------------------------------------
       _cut1 |  -1.141119   .0571667          (Ancillary parameters)
       _cut2 |  -.0371779   .0485592
       _cut3 |   1.110117   .0578593



------------------------------

Message: 28
Date: Wed, 10 Nov 2004 18:40:43 -0600
From: "Bizuet Cabrera Fernando" <fbizuet at banxico.org.mx>
Subject: [R] R with Sun Studio Fortran 95 compiler
To: <r-help at stat.math.ethz.ch>
Message-ID:
	<F74A1EABDCCFFB4893FD93C96408F58A021A53B8 at BMCORREO.banxico.org.mx>
Content-Type: text/plain;	charset="us-ascii"

Hi,

I am trying to compile R 1.9.1 and 2.0.0 on Solaris 2.8 with Sun Studio
Fortran 95 compiler but I have obtained some errors which I enclose. I
have compiled R with g77 GNU compiler and it was OK.

Does anyone know if R 2.0.0 has been successfully built on Solaris 2.8
with Sun Studio Fortran 95 compiler? or at least, How could I achieve
this? The R installation manual does not have any reference.

I want Sun Fortran in order to use the Sun performance library
libsunperf since I noticed that R on Windows XP is twice faster than R
on Sun Solaris 2.8 without library libsunperf.

Thanks in advance.

$ ./configure --enable-R-shlib
checking for a BSD-compatible install... tools/install-sh -c
checking whether build environment is sane... yes
checking whether make sets $(MAKE)... yes

... Skip

checking build system type... sparc-sun-solaris2.8
checking host system type... sparc-sun-solaris2.8
loading site script './config.site'

...skip

checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking whether gcc needs -traditional... no
checking how to run the C preprocessor... gcc -E
defining F77 to be f95
checking whether we are using the GNU Fortran 77 compiler... no
checking whether f95 accepts -g... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes

... skip

checking for f95 option to produce PIC... -fPIC
checking if f95 PIC flag -fPIC works... no
checking if f95 supports -c -o file.o... yes
checking whether the f95 linker (/usr/ccs/bin/ld) supports shared
libraries... yes
checking dynamic linker characteristics... f95: Warning: Option
-print-search-dirs passed to ld, if ld is invoked, ignored otherwise
Usage: f95 [ options ] files.  Use 'f95 -flags' for details
solaris2.8 ld.so
checking how to hardcode library paths into programs... immediate

...skip

checking how to get verbose linking output from f95... -v
checking for Fortran libraries of f95...  -L/usr/local/lib
-R/opt/SUNWspro/lib/v8plus:/opt/SUNWspro/lib -L/opt/SUNWspro/lib/v8plus
-L/opt/SUNWspro/prod/lib/v8plus -L/opt/SUNWspro/lib
-L/opt/SUNWspro/prod/lib -L/usr/ccs/lib -L/lib -L/usr/lib -lompstubs
-lfui -lfai -lfai2 -lfsumai -lfprodai -lfminlai -lfmaxlai -lfminvai
-lfmaxvai -lfsu -lsunmath -lm
checking for dummy main to link with Fortran libraries... unknown
configure: error: linking to Fortran libraries from C fails
See `config.log' for more details.



------------------------------

Message: 29
Date: Wed, 10 Nov 2004 16:43:41 -0800
From: Sundar Dorai-Raj <sundar.dorai-raj at pdf.com>
Subject: Re: [R] substitute/paste question for using Greek in plot
	titles
To: Peter Dunn <dunn at usq.edu.au>
Cc: R-help mailing list <R-help at stat.math.ethz.ch>
Message-ID: <4192B5BD.4070103 at pdf.com>
Content-Type: text/plain; charset=us-ascii; format=flowed



Peter Dunn wrote:

> Hi all
> 
> I am having troubles making sense of why code (1)
> below fails but code (2) below works.
> 
> Code (1):
> 
>  > phi.1 <- 1
>  > plot(0 ~ 0,
> + main=substitute(paste("A vaue for ",phi," = ",phival), 
> list(phival=phi.1)) )
> 
> Error in paste("The two deviances for ", phi, " = ", 2) :
>         Object "phi" not found
> 
> But this works:
> 
> Code (2):
>  > plot(0,0,
> + main=substitute(paste("A value for ",phi," = ",phival), 
> list(phival=phi.1)) )
>  >
> 
> It appears that if the plot command takes the formula style entry,
> the substitue/paste fails.
> 
> Is this documented as a feature (I couldn't find it if that is the
> case), or is it a bug?  If it is a feature, it is a subtle difference
> between (1) and (2) that has potential to be quite frustrating!
> 
> Perhaps I should just upgrade to version 2.0.0, though I can't see
> anything in the Release Notes that might cause this.
> 
> Thanks.
> 
> P.
> 
>  > version
>          _
> platform i686-pc-linux-gnu
> arch     i686
> os       linux-gnu
> system   i686, linux-gnu
> status
> major    1
> minor    9.1
> year     2004
> month    06
> day      21
> language R
> 
> 

Peter,

Because in the first couple of lines of plot.formula we see this:

dots <- m$...
dots <- lapply(dots, eval, data, parent.frame())

which for your case is equivalent to:

expr <- substitute(paste("A vaue for ",phi," = ",phival), 
list(phival=phi.1))
eval(expr)

which returns an error saying "phi" cannot be found which is the correct 
behaviour of eval. I'll let others comment on whether or not this is a 
bug in plot.formula but you can always get around it by calling title:

plot(0 ~ 0)
title(main = expr)

which is exactly what your second example is doing in plot.default.

HTH,

--sundar



------------------------------

Message: 30
Date: Wed, 10 Nov 2004 17:15:26 -0800 (PST)
From: Thomas Lumley <tlumley at u.washington.edu>
Subject: Re: [R] polr probit versus stata oprobit  
To: Jean Eid <jeaneid at chass.utoronto.ca>
Cc: r-help at stat.math.ethz.ch
Message-ID:
	<Pine.A41.4.61b.0411101707400.230306 at homer11.u.washington.edu>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

On Wed, 10 Nov 2004, Jean Eid wrote:

> Dear All,
> I have been struggling to understand why for the housing data in MASS
> library R and stata give coef. estimates that are really different. I also
> tried to come up with many many examples myself (see below, of course I
> did not have the set.seed command included) and all of my
> `random' examples seem to give verry similar output. For the housing data,
> I have changed the data into numeric vectors instead of factors/ordered
> factors. I did so to try and get the same results as in STATA and to have
> the housing example as close as possible to the one I constructed.
>
> I run a debian sid, kernel 2.4, R 2.0.0, and STATA version 8.2, MASS
> version  7.2-8.
>
>
> here's the example ( I assume that you have STATA installed and can run in
> batch mode, if not the output is also given below)
>

That example shows the same results with Stata and polr() from MASS.

For the housing data, I also get the same coefficients in Stata as with 
polr():

In R:
library(MASS)
library(foreign)
write.dta(housing, file="housing.dta")
house.probit<-polr(Sat ~ Infl + Type + Cont, data = housing, weights = 
Freq, method = "probit")
summary(house.probit)
-------------------------
Re-fitting to get Hessian

Call:
polr(formula = Sat ~ Infl + Type + Cont, data = housing, weights = Freq,
     method = "probit")

Coefficients:
                    Value Std. Error   t value
InflMedium     0.3464233 0.06413706  5.401297
InflHigh       0.7829149 0.07642620 10.244063
TypeApartment -0.3475372 0.07229093 -4.807480
TypeAtrium    -0.2178874 0.09476607 -2.299213
TypeTerrace   -0.6641737 0.09180004 -7.235005
ContHigh       0.2223862 0.05812267  3.826153

Intercepts:
             Value   Std. Error t value
Low|Medium  -0.2998  0.0762    -3.9371
Medium|High  0.4267  0.0764     5.5850

Residual Deviance: 3479.689
AIC: 3495.689
------------------------


In Stata
-----------------
. use housing.dta
. xi: oprobit Sat i.Infl i.Type i.Cont [fw=Freq]
i.Infl            _IInfl_1-3          (naturally coded; _IInfl_1 omitted)
i.Type            _IType_1-4          (naturally coded; _IType_1 omitted)
i.Cont            _ICont_1-2          (naturally coded; _ICont_1 omitted)

Iteration 0:   log likelihood = -1824.4388
Iteration 1:   log likelihood = -1739.9254
Iteration 2:   log likelihood = -1739.8444

Ordered probit estimates                          Number of obs   =    1681
                                                   LR chi2(6)      =   169.19
                                                   Prob > chi2     =   0.0000
Log likelihood = -1739.8444                       Pseudo R2       =   0.0464

------------------------------------------------------------------------------
          Sat |      Coef.   Std. Err.      z    P>|z|     [95% Conf. 
Interval]
-------------+----------------------------------------------------------------
     _IInfl_2 |   .3464228    .064137     5.40   0.000     .2207165     .472129
     _IInfl_3 |   .7829146    .076426    10.24   0.000     .6331224    .9327069
     _IType_2 |  -.3475367   .0722908    -4.81   0.000    -.4892241   -.2058493
     _IType_3 |  -.2178875    .094766    -2.30   0.021    -.4036254   -.0321497
     _IType_4 |  -.6641735   .0917999    -7.24   0.000     -.844098    -.484249
     _ICont_2 |   .2223858   .0581226     3.83   0.000     .1084676     .336304
-------------+----------------------------------------------------------------
        _cut1 |  -.2998279   .0761537          (Ancillary parameters)
        _cut2 |   .4267208   .0764043
------------------------------------------------------------------------------



 	-thomas



------------------------------

Message: 31
Date: Wed, 10 Nov 2004 21:09:21 -0500
From: Jean Eid <jeaneid at chass.utoronto.ca>
Subject: Re: [R] polr probit versus stata oprobit  
To: Thomas Lumley <tlumley at u.washington.edu>
Cc: r-help at stat.math.ethz.ch
Message-ID:
	<Pine.SGI.4.40.0411102108010.52139612-100000 at origin.chass.utoronto.ca>
Content-Type: TEXT/PLAIN; charset=US-ASCII

Dear Thomas,

Where you also able to replicate the second example?  (the exaample
that I turned the housing data into numerical variables) That is the one
that my estimates differ.

Jean,

On Wed, 10 Nov 2004, Thomas Lumley wrote:

> On Wed, 10 Nov 2004, Jean Eid wrote:
>
> > Dear All,
> > I have been struggling to understand why for the housing data in MASS
> > library R and stata give coef. estimates that are really different. I also
> > tried to come up with many many examples myself (see below, of course I
> > did not have the set.seed command included) and all of my
> > `random' examples seem to give verry similar output. For the housing data,
> > I have changed the data into numeric vectors instead of factors/ordered
> > factors. I did so to try and get the same results as in STATA and to have
> > the housing example as close as possible to the one I constructed.
> >
> > I run a debian sid, kernel 2.4, R 2.0.0, and STATA version 8.2, MASS
> > version  7.2-8.
> >
> >
> > here's the example ( I assume that you have STATA installed and can run in
> > batch mode, if not the output is also given below)
> >
>
> That example shows the same results with Stata and polr() from MASS.
>
> For the housing data, I also get the same coefficients in Stata as with
> polr():
>
> In R:
> library(MASS)
> library(foreign)
> write.dta(housing, file="housing.dta")
> house.probit<-polr(Sat ~ Infl + Type + Cont, data = housing, weights =
> Freq, method = "probit")
> summary(house.probit)
> -------------------------
> Re-fitting to get Hessian
>
> Call:
> polr(formula = Sat ~ Infl + Type + Cont, data = housing, weights = Freq,
>      method = "probit")
>
> Coefficients:
>                     Value Std. Error   t value
> InflMedium     0.3464233 0.06413706  5.401297
> InflHigh       0.7829149 0.07642620 10.244063
> TypeApartment -0.3475372 0.07229093 -4.807480
> TypeAtrium    -0.2178874 0.09476607 -2.299213
> TypeTerrace   -0.6641737 0.09180004 -7.235005
> ContHigh       0.2223862 0.05812267  3.826153
>
> Intercepts:
>              Value   Std. Error t value
> Low|Medium  -0.2998  0.0762    -3.9371
> Medium|High  0.4267  0.0764     5.5850
>
> Residual Deviance: 3479.689
> AIC: 3495.689
> ------------------------
>
>
> In Stata
> -----------------
> . use housing.dta
> . xi: oprobit Sat i.Infl i.Type i.Cont [fw=Freq]
> i.Infl            _IInfl_1-3          (naturally coded; _IInfl_1 omitted)
> i.Type            _IType_1-4          (naturally coded; _IType_1 omitted)
> i.Cont            _ICont_1-2          (naturally coded; _ICont_1 omitted)
>
> Iteration 0:   log likelihood = -1824.4388
> Iteration 1:   log likelihood = -1739.9254
> Iteration 2:   log likelihood = -1739.8444
>
> Ordered probit estimates                          Number of obs   =    1681
>                                                    LR chi2(6)      =   169.19
>                                                    Prob > chi2     =   0.0000
> Log likelihood = -1739.8444                       Pseudo R2       =   0.0464
>
> ------------------------------------------------------------------------------
>           Sat |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
> Interval]
> -------------+----------------------------------------------------------------
>      _IInfl_2 |   .3464228    .064137     5.40   0.000     .2207165     .472129
>      _IInfl_3 |   .7829146    .076426    10.24   0.000     .6331224    .9327069
>      _IType_2 |  -.3475367   .0722908    -4.81   0.000    -.4892241   -.2058493
>      _IType_3 |  -.2178875    .094766    -2.30   0.021    -.4036254   -.0321497
>      _IType_4 |  -.6641735   .0917999    -7.24   0.000     -.844098    -.484249
>      _ICont_2 |   .2223858   .0581226     3.83   0.000     .1084676     .336304
> -------------+----------------------------------------------------------------
>         _cut1 |  -.2998279   .0761537          (Ancillary parameters)
>         _cut2 |   .4267208   .0764043
> ------------------------------------------------------------------------------
>
>
>
>  	-thomas
>



------------------------------

Message: 32
Date: Wed, 10 Nov 2004 23:08:23 -0500
From: "Roger D. Peng" <rpeng at jhsph.edu>
Subject: Re: [R] substitute/paste question for using Greek in plot
	titles
To: Sundar Dorai-Raj <sundar.dorai-raj at pdf.com>
Cc: Peter Dunn <dunn at usq.edu.au>,	R-help mailing list
	<R-help at stat.math.ethz.ch>
Message-ID: <4192E5B7.3050203 at jhsph.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

This is not a bug.  The object passed to `main' should be either character or an 
expression (documented in ?title).  substitute() returns neither a character 
object nor an expression -- it return a call object.  This is documented in 
?substitute:

      Substituting and quoting often causes confusion when the argument
      is 'expression(...)'. The result is a call to the 'expression'
      constructor function and needs to be evaluated with 'eval' to give
      the actual expression object.

What you want, I think, is

label <- substitute(expression(paste("A vaue for ",phi," = ",phival)), 
list(phival=phi.1))
plot(0 ~ 0, main = eval(label))

-roger

Sundar Dorai-Raj wrote:
> 
> 
> Peter Dunn wrote:
> 
>> Hi all
>>
>> I am having troubles making sense of why code (1)
>> below fails but code (2) below works.
>>
>> Code (1):
>>
>>  > phi.1 <- 1
>>  > plot(0 ~ 0,
>> + main=substitute(paste("A vaue for ",phi," = ",phival), 
>> list(phival=phi.1)) )
>>
>> Error in paste("The two deviances for ", phi, " = ", 2) :
>>         Object "phi" not found
>>
>> But this works:
>>
>> Code (2):
>>  > plot(0,0,
>> + main=substitute(paste("A value for ",phi," = ",phival), 
>> list(phival=phi.1)) )
>>  >
>>
>> It appears that if the plot command takes the formula style entry,
>> the substitue/paste fails.
>>
>> Is this documented as a feature (I couldn't find it if that is the
>> case), or is it a bug?  If it is a feature, it is a subtle difference
>> between (1) and (2) that has potential to be quite frustrating!
>>
>> Perhaps I should just upgrade to version 2.0.0, though I can't see
>> anything in the Release Notes that might cause this.
>>
>> Thanks.
>>
>> P.
>>
>>  > version
>>          _
>> platform i686-pc-linux-gnu
>> arch     i686
>> os       linux-gnu
>> system   i686, linux-gnu
>> status
>> major    1
>> minor    9.1
>> year     2004
>> month    06
>> day      21
>> language R
>>
>>
> 
> Peter,
> 
> Because in the first couple of lines of plot.formula we see this:
> 
> dots <- m$...
> dots <- lapply(dots, eval, data, parent.frame())
> 
> which for your case is equivalent to:
> 
> expr <- substitute(paste("A vaue for ",phi," = ",phival), 
> list(phival=phi.1))
> eval(expr)
> 
> which returns an error saying "phi" cannot be found which is the correct 
> behaviour of eval. I'll let others comment on whether or not this is a 
> bug in plot.formula but you can always get around it by calling title:
> 
> plot(0 ~ 0)
> title(main = expr)
> 
> which is exactly what your second example is doing in plot.default.
> 
> HTH,
> 
> --sundar
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 

-- 
Roger D. Peng
http://www.biostat.jhsph.edu/~rpeng/



------------------------------

Message: 33
Date: Wed, 10 Nov 2004 20:20:01 -0800
From: Gang Liang <liang at ics.uci.edu>
Subject: [R] "<<-" assignment no long work in class methods
To: r-help at stat.math.ethz.ch
Message-ID: <20041111042001.GL11620 at opensrc>
Content-Type: text/plain; charset=us-ascii

Hi-

I used to use "<<-" to do assignment inside a class method, and
just found that now it is broken in R 2.0. For example, the
following code

-----------------------------------------------------------------------
setClass( "myclass", representation(x="numeric") )
setGeneric("incrXByOne", function(obj) standardGeneric("incrXByOne"))
setMethod( "incrXByOne", "myclass", function(obj) obj at x <<- obj at x + 1 )

incrXByOne( new("myclass") )
-----------------------------------------------------------------------

will give an error message like:

   Error in incrXByOne(new("myclass")) : Object "obj" not found
   ## R failed to trace the object back to the GlobalEnv...

It used to work under R1.7 - 1.9. I don't know whether this is a
bug or a new feature...

Anyone can recommend a workaround?

Thanks, Gang

-----------------------------
debian unstable, kernel 2.6.8

> version

platform i386-pc-linux-gnu
arch     i386
os       linux-gnu
system   i386, linux-gnu
status
major    2
minor    0.0
year     2004
month    10
day      04
language R



------------------------------

Message: 34
Date: Thu, 11 Nov 2004 08:30:25 +0100
From: Witold Eryk Wolski <wolski at molgen.mpg.de>
Subject: Re: [R] "<<-" assignment no long work in class methods
To: Gang Liang <liang at ics.uci.edu>
Cc: r-help at stat.math.ethz.ch
Message-ID: <41931511.7080809 at molgen.mpg.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Gang Liang wrote:

>Hi-
>
>I used to use "<<-" to do assignment inside a class method, and
>just found that now it is broken in R 2.0. For example, the
>following code
>
>-----------------------------------------------------------------------
>setClass( "myclass", representation(x="numeric") )
>setGeneric("incrXByOne", function(obj) standardGeneric("incrXByOne"))
>setMethod( "incrXByOne", "myclass", function(obj) obj at x <<- obj at x + 1 )
>
>  
>
Hi,

What (my guess) you want to define is:

setMethod( "incrXByOne", "myclass", function(obj) {obj at x <- obj at x + 1;obj})

You do not need "<<-" to assign to a function argument? Its in my view 
even erroneous.

This S code gives an error too.

test <- function(x)
{
x$bla<<-x$bla + 1
}
test(1)
Error in test(1) : Object "x" not found

/E

>incrXByOne( new("myclass") )
>-----------------------------------------------------------------------
>
>will give an error message like:
>
>   Error in incrXByOne(new("myclass")) : Object "obj" not found
>   ## R failed to trace the object back to the GlobalEnv...
>
>It used to work under R1.7 - 1.9. I don't know whether this is a
>bug or a new feature...
>
>Anyone can recommend a workaround?
>
>Thanks, Gang
>
>-----------------------------
>debian unstable, kernel 2.6.8
>
>  
>
>>version
>>    
>>
>
>platform i386-pc-linux-gnu
>arch     i386
>os       linux-gnu
>system   i386, linux-gnu
>status
>major    2
>minor    0.0
>year     2004
>month    10
>day      04
>language R
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>  
>


-- 
Dipl. bio-chem. Witold Eryk Wolski
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin
tel: 0049-30-83875219                 __("<    _
http://www.molgen.mpg.de/~wolski      \__/    'v'
http://r4proteomics.sourceforge.net    ||    /   \
mail: witek96 at users.sourceforge.net    ^^     m m
      wolski at molgen.mpg.de



------------------------------

Message: 35
Date: Thu, 11 Nov 2004 07:32:30 +0000 (GMT)
From: Prof Brian Ripley <ripley at stats.ox.ac.uk>
Subject: Re: [R] R with Sun Studio Fortran 95 compiler
To: Bizuet Cabrera Fernando <fbizuet at banxico.org.mx>
Cc: r-help at stat.math.ethz.ch
Message-ID: <Pine.LNX.4.44.0411110723220.9124-100000 at gannet.stats>
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Wed, 10 Nov 2004, Bizuet Cabrera Fernando wrote:

> I am trying to compile R 1.9.1 and 2.0.0 on Solaris 2.8 with Sun Studio
> Fortran 95 compiler but I have obtained some errors which I enclose. I
> have compiled R with g77 GNU compiler and it was OK.

Please do read the final line of your excerpt and do as it says ....

> Does anyone know if R 2.0.0 has been successfully built on Solaris 2.8
> with Sun Studio Fortran 95 compiler? or at least, How could I achieve
> this? The R installation manual does not have any reference.

What is `Sun Studio'?  The R-admin manual does have references to what I
think is the same compiler, `Sun ONE Studio 7 Compiler Suite' (aka Forte
7) (possibly not the same version).  Forte 9 has also been used 
successfully, if -xopenmp=stubs was added to LDFLAGS (and that is in the 
R-admin manual for the imminent R 2.0.1).

> I want Sun Fortran in order to use the Sun performance library
> libsunperf since I noticed that R on Windows XP is twice faster than R
> on Sun Solaris 2.8 without library libsunperf.

Yes, well, not at the same clock speed.  Please do read the experience in 
the R-admin manual that you deny exists.

Either you are talking about a different product with a very similar name 
or you have missed a lot of useful information.

> Thanks in advance.
> 
> $ ./configure --enable-R-shlib
> checking for a BSD-compatible install... tools/install-sh -c
> checking whether build environment is sane... yes
> checking whether make sets $(MAKE)... yes
> 
> ... Skip
> 
> checking build system type... sparc-sun-solaris2.8
> checking host system type... sparc-sun-solaris2.8
> loading site script './config.site'
> 
> ...skip
> 
> checking for gcc... gcc
> checking for C compiler default output file name... a.out
> checking whether the C compiler works... yes
> checking whether we are cross compiling... no
> checking for suffix of executables... 
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc accepts -g... yes
> checking for gcc option to accept ANSI C... none needed
> checking how to run the C preprocessor... gcc -E
> checking whether gcc needs -traditional... no
> checking how to run the C preprocessor... gcc -E
> defining F77 to be f95
> checking whether we are using the GNU Fortran 77 compiler... no
> checking whether f95 accepts -g... yes
> checking for g++... g++
> checking whether we are using the GNU C++ compiler... yes
> checking whether g++ accepts -g... yes
> 
> ... skip
> 
> checking for f95 option to produce PIC... -fPIC
> checking if f95 PIC flag -fPIC works... no
> checking if f95 supports -c -o file.o... yes
> checking whether the f95 linker (/usr/ccs/bin/ld) supports shared
> libraries... yes
> checking dynamic linker characteristics... f95: Warning: Option
> -print-search-dirs passed to ld, if ld is invoked, ignored otherwise
> Usage: f95 [ options ] files.  Use 'f95 -flags' for details
> solaris2.8 ld.so
> checking how to hardcode library paths into programs... immediate
> 
> ...skip
> 
> checking how to get verbose linking output from f95... -v
> checking for Fortran libraries of f95...  -L/usr/local/lib
> -R/opt/SUNWspro/lib/v8plus:/opt/SUNWspro/lib -L/opt/SUNWspro/lib/v8plus
> -L/opt/SUNWspro/prod/lib/v8plus -L/opt/SUNWspro/lib
> -L/opt/SUNWspro/prod/lib -L/usr/ccs/lib -L/lib -L/usr/lib -lompstubs
> -lfui -lfai -lfai2 -lfsumai -lfprodai -lfminlai -lfmaxlai -lfminvai
> -lfmaxvai -lfsu -lsunmath -lm
> checking for dummy main to link with Fortran libraries... unknown
> configure: error: linking to Fortran libraries from C fails
> See `config.log' for more details.
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 
> 

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
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, UK                Fax:  +44 1865 272595



------------------------------

Message: 36
Date: Thu, 11 Nov 2004 08:27:51 +0000
From: Diethelm Wuertz <wuertz at itp.phys.ethz.ch>
Subject: Re: [R] fSeries
To: CYRIL.CAILLAULT at FORTISINVESTMENTS.COM, r-help at stat.math.ethz.ch,
	vito_ricci at yahoo.com
Message-ID: <41932287.8020000 at itp.phys.ethz.ch>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed


1. Currently I'm writing a complete new GARCH package, and as long as it 
is not
yet ready I have added the garch function from Adrian Trapletti's 
tseries package
to the fSeries package.

2. But the error in the output you  observed  comes not from the "garch" 
function,
it comes from my "garchSim" function. Please modify the function 
garchSim() in the
following way ----


garchSim =
function(model = list(omega = 1.0e-06, alpha = 0.1, beta = 0.8, mu = 0),
n = 100, innov = NULL, n.start = 100, start.innov = NULL, rand.gen = 
rnorm, ...)
{    
    # Doesn't work, replace the three following lines ... 
    # if (!exists("model$alpha")) model$alpha = 0
    # if (!exists("model$beta")) model$beta = 0
    # if (!exists("model$mu")) model$mu = 0
   
    # with ...
    if (is.null(model$alpha)) model$alpha = 0
    if (is.null(model$beta)) model$beta = 0
    if (is.null(model$mu)) model$mu = 0

    max.order = max(length(model$alpha), length(model$beta))
    if (n.start < max.order)
        stop("n.start must be greater or equal max(alpha, beta)")
    if (is.null(start.innov))
        start.innov = rand.gen(n.start, ...)
    if (is.null(innov))
        innov = rand.gen(n, ...)
    h = x = z = c(start.innov, innov)
    for (i in 1:max.order) {
        h[i] = model$omega/(1 - sum(model$alpha) - sum(model$beta))
        x[i] = sqrt(h[i]) * z[i] + model$mu
    }
    n.alpha = length(model$alpha)
    n.beta = length(model$beta)
    for (i in (max.order + 1):(n.start + n)) {
        h[i] = model$omega + sum(model$alpha * x[i - (1:n.alpha)]^2) +
            sum(model$beta * h[i - (1:n.beta)])
        x[i] = sqrt(h[i]) * z[i] + model$mu
    }
    as.ts(x[-(1:n.start)])
}


and try the folloowing examples:


require(fSeries)

garchFit(garchSim(n = 1000))

garchFit(garchSim(model = list(omega = 1.0e-06, alpha = 0.1, beta = 0.8,
    mu = 0), n =1000))

garchFit(garchSim(model = list(omega = 1.0e-06, alpha = 0.6), n = 1000))
garchFit(garchSim(model = list(omega = 1.0e-06, alpha = 0.6), n = 1000),
    order=c(0, 1))
   

The code will be updated in the next fSeries package.
I apologize for any inconvenience caused by this bug.

Diethelm Wuertz



CYRIL.CAILLAULT at FORTISINVESTMENTS.COM wrote:

>Good morning everyone,
>
>I use for the first time the package fSeries and i try to run the example
>given by Diethelm Würtz. But when i run its example which is the following 
>#
># Example: 
>#	Model a GARCH time series process 
>#
># Description:
>#	PART I: Estimate GARCH models of the following type ARCH(2) 
>#     and GARCH(1,1) with normal conditional distribution functions.
>#   PART II: Simulate GARCH models of the following type, ARCH(2) 
>#     and GARCH(1,1),
>#	with normal conditional distribution functions.
>#
># Author:
>#	(C) 2002, Diethelm Wuertz, GPL
>#
>
>
>############################################################################
>####
># PART I: Estimation:
>
>	# Settings:
>	set.seed(547)
>    # Bollerslev's GARCH(1,1) with normal innovations:
>	model = list(omega = 1e-6, alpha = 0.1, beta = 0.8, mu = 0)
>	x = garchSim(model, n = 1000)
>	fit = garchFit(as.numeric(x), order = c(1, 1))
>	print(fit)
>	# Summary and Diagnostic Analysis:
>	summary(fit)
>	# Plot Results:
>	par(mfrow = c(2, 2))
>	plot(fit)
>	###
>
>Results of the estimations are false.
>
>Call:
>garchFit(x = as.numeric(x), order = c(1, 1))
>
>Coefficient(s):
>    omega         a1         b1  
>8.564e-07  5.000e-02  5.000e-02  
>
>To compare with : omega = 1e-6, alpha = 0.1, beta = 0.8.
>
>Do you have some information about this?
>Can I give some initials values to start the estimations?
>Can I use different innovation process like student-t and GED
>
>Thanks for your answers
>
>Cyril 
>
>
>
>
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>  
>



------------------------------

Message: 37
Date: Thu, 11 Nov 2004 08:42:38 +0000
From: Diethelm Wuertz <wuertz at itp.phys.ethz.ch>
Subject: Re: [R] fSeries
To: Diethelm Wuertz <wuertz at itp.phys.ethz.ch>,
	r-help at stat.math.ethz.ch
Message-ID: <419325FE.5010906 at itp.phys.ethz.ch>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Diethelm Wuertz wrote:

Tabs removed from the code, makes a nicer printout ....

garchSim =
function(model = list(omega = 1.0e-06, alpha = 0.1, beta = 0.8, mu = 0),
n = 100, innov = NULL, n.start = 100, start.innov = NULL, rand.gen = 
rnorm, ...)
{    
    # Doesn't work, replace the three following three lines ... 
    # if (!exists("model$alpha")) model$alpha = 0
    # if (!exists("model$beta")) model$beta = 0
    # if (!exists("model$mu")) model$mu = 0
   
    # with ...
    if (is.null(model$alpha)) model$alpha = 0
    if (is.null(model$beta)) model$beta = 0
    if (is.null(model$mu)) model$mu = 0

    max.order = max(length(model$alpha), length(model$beta))
    if (n.start < max.order)
        stop("n.start must be greater or equal max(alpha,beta)")
    if (is.null(start.innov))
        start.innov = rand.gen(n.start, ...)
    if (is.null(innov))
        innov = rand.gen(n, ...)
    h = x = z = c(start.innov, innov)
    for (i in 1:max.order) {
        h[i] = model$omega/(1 - sum(model$alpha) - sum(model$beta))
        x[i] = sqrt(h[i]) * z[i] + model$mu
    }
    n.alpha = length(model$alpha)
    n.beta = length(model$beta)
    for (i in (max.order + 1):(n.start + n)) {
        h[i] = model$omega + sum(model$alpha * x[i - (1:n.alpha)]^2) +
            sum(model$beta * h[i - (1:n.beta)])
        x[i] = sqrt(h[i]) * z[i] + model$mu
    }
    as.ts(x[-(1:n.start)])
}



------------------------------

Message: 38
Date: Thu, 11 Nov 2004 10:29:58 +0100 (CET)
From: "Alicia Amadoz"<Alicia.Amadoz at uv.es>
Subject: [R] RSPerl problem with testing
To: r-help at stat.math.ethz.ch
Message-ID: <6217119899amadoz at uv.es>
Content-Type: text/plain;	charset="ISO-8859-1"

Hi,

I'm trying to install de RSPerl module and i have some problems trying
to test it. I've tried to contact with the author but the e-mail address
seems not to exist. Hope that anyone in this list could explain me a
little about this problem. I have a bash shell and what i do is the
following:

#PERLLIB=/usr/lib/R/library/RSPerl/share/blib/arch:/usr/lib/R/library/RSPerl/share/blib/lib
# export PERLLIB
# LD_LIBRARY_PATH=/usr/lib/R/bin:/usr/lib/R/library/RSPerl/libs
# export LD_LIBRARY_PATH
# perl test.pl
1..1
Can't load '/usr/lib/R/library/RSPerl/share/blib/arch/auto/R/R.so' for
module R: /usr/lib/R/library/RSPerl/libs/libPerlConverter.so: undefined
symbol: R_GlobalEnv at
/usr/lib/perl5/5.8.3/i386-linux-thread-multi/DynaLoader.pm line 229.
 at test.pl line 11
Compilation failed in require at test.pl line 11.
BEGIN failed--compilation aborted at test.pl line 11.
not ok 1

I move to the /usr/local/src to test again and  i get the same error.

Any help would be much appreciated. Thanks.

Regards,
Alicia


***********************************************
Alicia Amadoz
Evolutionary Genetics Unit
Cavanilles Institute for Biodiversity and Evolutionary
Biology
University of Valencia
Apartado Oficial 22085
E-46071 Valencia SPAIN
Phone: (+34) 96 354 3687
FAX: (+34) 96 354 3670
e-mail: alicia.amadoz at uv.es
http://www.uv.es/~amadoz
***********************************************
NOTE! For shipments by EXPRESS COURIER use "Instituto
Cavanilles de Biodiversidad y Biología Evolutiva,
Polígono de la Coma s/n, 46980 Paterna (Valencia),
Spain" instead of P.O. Box no. and Post Code/City above.



------------------------------

Message: 39
Date: Thu, 11 Nov 2004 09:44:27 +0000 (GMT)
From: Prof Brian Ripley <ripley at stats.ox.ac.uk>
Subject: Re: [R] RSPerl problem with testing
To: Alicia Amadoz <Alicia.Amadoz at uv.es>
Cc: r-help at stat.math.ethz.ch
Message-ID: <Pine.LNX.4.44.0411110941310.16804-100000 at gannet.stats>
Content-Type: TEXT/PLAIN; charset=US-ASCII

The author is at  <duncan at wald.ucdavis.edu>: this is an Omegahat product 
and I think the Omegahat web pages do lead you there.

Looks to me as if you haven't got the R shared library in your load 
library path: if this is R 2.0.x it is in /usr/lib/R/lib, not bin.

On Thu, 11 Nov 2004, Alicia Amadoz wrote:

> Hi,
> 
> I'm trying to install de RSPerl module and i have some problems trying
> to test it. I've tried to contact with the author but the e-mail address
> seems not to exist. Hope that anyone in this list could explain me a
> little about this problem. I have a bash shell and what i do is the
> following:
> 
> #PERLLIB=/usr/lib/R/library/RSPerl/share/blib/arch:/usr/lib/R/library/RSPerl/share/blib/lib
> # export PERLLIB
> # LD_LIBRARY_PATH=/usr/lib/R/bin:/usr/lib/R/library/RSPerl/libs
> # export LD_LIBRARY_PATH
> # perl test.pl
> 1..1
> Can't load '/usr/lib/R/library/RSPerl/share/blib/arch/auto/R/R.so' for
> module R: /usr/lib/R/library/RSPerl/libs/libPerlConverter.so: undefined
> symbol: R_GlobalEnv at
> /usr/lib/perl5/5.8.3/i386-linux-thread-multi/DynaLoader.pm line 229.
>  at test.pl line 11
> Compilation failed in require at test.pl line 11.
> BEGIN failed--compilation aborted at test.pl line 11.
> not ok 1

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
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, UK                Fax:  +44 1865 272595



------------------------------

Message: 40
Date: Thu, 11 Nov 2004 10:08:47 +0000
From: "dave wilton" <dave_wilton at hotmail.com>
Subject: [R] smoothing techniques
To: R-help at stat.math.ethz.ch
Message-ID: <BAY16-F11KO8FNpyLAP0001a602 at hotmail.com>
Content-Type: text/plain; format=flowed

Hi

I was wondering if you could help. I am trying to programme both the maximum 
entropy method algorithm and the continuous wavelet transform into R but am 
having quite a lot of diffulculties. Could you suggest anything.

Many Thanks

David Wilton



------------------------------

Message: 41
Date: Thu, 11 Nov 2004 11:31:00 +0100
From: Martyn Plummer <plummer at iarc.fr>
Subject: Re: [R] R works on Fedora Core 3
To: Jonathan Baron <baron at psych.upenn.edu>
Cc: Jari Oksanen <jari.oksanen at oulu.fi>, r-help at stat.math.ethz.ch
Message-ID: <1100169060.24764.51.camel at nemo>
Content-Type: text/plain

On Wed, 2004-11-10 at 09:19 +0100, Martyn Plummer wrote:
> On Tue, 2004-11-09 at 19:47, Jonathan Baron wrote:
> > On 11/09/04 20:37, Jari Oksanen wrote:
> > >
> > >On 9 Nov 2004, at 19:44, Jonathan Baron wrote:
> > >
> > >> The RPM for Fedora Core 2 seems to work just fine on Core 3.
> > >>
> > >> (The graphics window got smaller, but I'm sure there is a setting
> > >> for that.)
> > >>
> > >That would be good news. I really don't know how the graphics window
> > >became so big at some stage. (MacOS X is just cute here: tiny, sharp,
> > >fast graphics window.)
> > 
> > I have the opposite problem, a 1680x1050 display.
> > 
> > >Has the options()printcmd reappeared, so that dev.print() works without
> > >changing default options?
> > 
> > I can't imagine how this would change.  This is the same "old"
> > RPM, not a new one.  The option is there, and I don't think it
> > ever disappeared.  I can't test it.  This is my laptop, which is
> > not set up to print anything.
> 
> My mistake.  The default print command is determined at configure time.
> But the RedHat RPMS are built in a sandbox that has only the minimal
> configuration needed to build R. This doesn't include the lpr package so
> the default print command is null. I will fix this in the next RPM
> release, but right now I am upgrading to FC3. 

An RPM for Fedora Core 3 should be on a CRAN mirror near you by the
weekend. This fixes the printcmd bug.

The X11() window is the right size for me, but it doesn't have a title
bar, which is a nuisance.

Martyn



------------------------------

Message: 42
Date: Thu, 11 Nov 2004 10:46:04 +0000
From: Gavin Simpson <gavin.simpson at ucl.ac.uk>
Subject: Re: [R] R works on Fedora Core 3
To: Martyn Plummer <plummer at iarc.fr>
Cc: Jonathan Baron <baron at psych.upenn.edu>, Jari Oksanen
	<jari.oksanen at oulu.fi>,	r-help at stat.math.ethz.ch
Message-ID: <419342EC.5090008 at ucl.ac.uk>
Content-Type: text/plain; charset=us-ascii; format=flowed

Martyn Plummer wrote:
> On Wed, 2004-11-10 at 09:19 +0100, Martyn Plummer wrote:
> 

<snip>

> An RPM for Fedora Core 3 should be on a CRAN mirror near you by the
> weekend. This fixes the printcmd bug.
> 
> The X11() window is the right size for me, but it doesn't have a title
> bar, which is a nuisance.
> 
> Martyn
> 

I have this "problem" with both your rpm on FC2 and when compiled from 
sources (1.9.1-patched 2.0.0-patched [now 2.0.1 beta]). The title bar 
comes and goes, seemingly at random (I've not systematically test this 
so I haven't found an underlying cause) when a new X11() device is 
started. Mainly a more complex plot (over several lines and commands) 
will fail to produce the title bar, if I then close that device and open 
another using something simple, say plot(1:10) then I more often than 
not get the title bar. I say more often than not, because sometimes I 
have to run that command a few times, closing the opened faulty device 
window in between to get the title bar to appear. Same result running R 
from within xemacs/ess.

Gav

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Gavin Simpson                     [T] +44 (0)20 7679 5522
ENSIS Research Fellow             [F] +44 (0)20 7679 7565
ENSIS Ltd. & ECRC                 [E] gavin.simpson at ucl.ac.uk
UCL Department of Geography       [W] http://www.ucl.ac.uk/~ucfagls/cv/
26 Bedford Way                    [W] http://www.ucl.ac.uk/~ucfagls/
London.  WC1H 0AP.
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



------------------------------

Message: 43
Date: Thu, 11 Nov 2004 10:58:46 +0000
From: Bernie McConnell <bm8 at st-andrews.ac.uk>
Subject: [R] RODBC & POSIX & Daylight Saving blues
To: r-help at stat.math.ethz.ch
Message-ID: <6.1.2.0.0.20041110173817.025a3e40 at bute.st-and.ac.uk>
Content-Type: text/plain; charset="us-ascii"; format=flowed

Dear All,

The recent improvement in RODBC to recognize datetimes in tables has 
exposed my ongoing confusion.

All my data are obtained from a satellite system (Argos) which tags events 
in the GMT time zone.  Daylight saving is ignored.  To my way of thinking 
this means that

   1.  twelve-o-clock means halfway through the day regardless of season, and
   2.  the difftime of any two dates where the time is set to 
twelve-o-clock should be an integer, regardless of which season each of the 
dates are in.

I illustrate my confusion with a two-line table in an Access 2000 database 
table where the single field called 'theDate' contains the two values:

30/07/04 12:00:00
30/11/04 12:00:00

then I bring the datetimes into R with the following code:

 > library (RODBC)
 > theChannel <- odbcConnect("phonetagcopy", "", "")
 > pp <- sqlFetch(theChannel, "DateTest")
 > odbcClose(theChannel)
 > pp$theDate
[1] "2004-07-30 12:00:00 GMT Daylight Time"
[2] "2004-11-30 12:00:00 GMT Standard Time"
 >
 > unclass(pp$theDate) / 86400
[1] 12629.46 12752.50
attr(,"tzone")
[1] ""
 >
 > difftime (pp$theDate[1], pp$theDate[2])
Time difference of -123.0417 days

It appears that sqlFetch has (in this case wrongly) assumed that my 
datetimes are corrected for Daylight Saving.  How can I persuade it to 
accept that all my datetimes are in straight GMT?

OS:Win2000
R 2.0.0
RODBC version 1.1-2
Sys.getlocale()
[1] "LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United 
Kingdom.1252;LC_MONETARY=C;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252"
 >


Many thanks

Bernie McConnell

Sea Mammal Research Unit
University of St Andrews



------------------------------

_______________________________________________
R-help at stat.math.ethz.ch mailing list  
https://stat.ethz.ch/mailman/listinfo/r-help 
PLEASE read the posting guide! http://www.R-project.org/posting-guide.html


End of R-help Digest, Vol 21, Issue 11




More information about the R-help mailing list