Re: [R] Is it a bug ?

2007-07-05 Thread Uwe Ligges
I don't get your point, because

  exp(-(-3)^2.2)
[1] NaN

is correct. A negative value to the power of a non-integer is undefined 
in IR. Of course it is defined as a complex number:

  exp(-(-3+0i)^2.2)
[1] 1.096538e-04-3.47404e-05i

Uwe Ligges




Giuseppe PEDRAZZI wrote:
   [[diverted from R-bugs to R-help by the list maintainer]]
 
 Dear Friend and distinguished R gurus,
 
 first of all really thank you very much for the marvellous tool that is R.
 
 I am using R 2.5.0,  windows XP - italian language.
 
 I was perfoming some calculation on fractional exponential and
 I found a strange behaviour. I do not know if it is really a bug, but I would 
 expect
 a different answer from R.
 
 I was trying the following :
 
 x - seq(-3,3, by =0.1)
 n - 2.2
 y - exp(-x^n)
 
 well, the y vector contains (NaN for all negative value of x)
 
 but if you ask for single value calculation like
 
 y - exp(-(-3)^2.2) or 
 
 y - exp(-(-2.9)^2.2)
 
 the answer is correct. 
 It seem it does not make the calculation in vector form.
 
 I got the same behaviour (NaN)  in a for loop
 
 for(i in 1:length(x)) y[i]=exp(x[i]^n)
 y
  [1]   NaN  NaN  NaN  NaN  NaN
   NaN  NaN  NaN  NaN
 [10]  NaN  NaN  NaN  NaN  NaN 
  NaN  NaN  NaN  NaN
 [19]  NaN  NaN  NaN  NaN  NaN 
  NaN  NaN  NaN  NaN
 [28]  NaN  NaN  NaN 1.00 1.006330 
 1.029416 1.073302 1.142488 1.243137
 [37] 1.384082 1.578166 1.844237 2.210260 2.718282 
 3.432491 4.452553 5.936068 8.137120
 [46]11.47374616.64841524.86768038.25129560.611092
 98.967689   166.572985   289.08   517.425935
 [55]   955.487320  1820.793570  3581.521323  7273.674928 15255.446778 
 33050.861013 73982.100407
 
 Is it strange or did I miss something ?
 
 Many thanks for the attention.
 
 
 Very best regards
 
 Giuseppe Pedrazzi
 Dept Public Health, Physics Division
 University of Parma, Italy
   [[alternative HTML version deleted]]
 
 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Is it a bug ?

2007-07-05 Thread Thomas Lumley
On Thu, 5 Jul 2007, Giuseppe PEDRAZZI wrote:
 I am using R 2.5.0,  windows XP - italian language.

 I was perfoming some calculation on fractional exponential and
 I found a strange behaviour. I do not know if it is really a bug, but I would 
 expect
 a different answer from R.

 I was trying the following :

 x - seq(-3,3, by =0.1)
 n - 2.2
 y - exp(-x^n)

 well, the y vector contains (NaN for all negative value of x)

Yes. Non-integer powers of negative numbers are undefined (unless you use 
complex numbers).

 but if you ask for single value calculation like

 y - exp(-(-3)^2.2) or

 y - exp(-(-2.9)^2.2)

 the answer is correct.

I get NaN for both of these.  Perhaps you mean exp(-2.9^2.2)? This gives 
a valid answer, but that is because it is exp(-(2.9^2.2)) not 
exp((-2.9)^2.2)

 It seem it does not make the calculation in vector form.

 I got the same behaviour (NaN)  in a for loop

 for(i in 1:length(x)) y[i]=exp(x[i]^n)
 y
 [1]   NaN  NaN  NaN  NaN  NaN 
  NaN  NaN  NaN  NaN
 [10]  NaN  NaN  NaN  NaN  NaN 
  NaN  NaN  NaN  NaN
 [19]  NaN  NaN  NaN  NaN  NaN 
  NaN  NaN  NaN  NaN
 [28]  NaN  NaN  NaN 1.00 1.006330 
 1.029416 1.073302 1.142488 1.243137
 [37] 1.384082 1.578166 1.844237 2.210260 2.718282 
 3.432491 4.452553 5.936068 8.137120
 [46]11.47374616.64841524.86768038.25129560.611092
 98.967689   166.572985   289.08   517.425935
 [55]   955.487320  1820.793570  3581.521323  7273.674928 15255.446778 
 33050.861013 73982.100407


 Is it strange or did I miss something ?

You missed something. It is not clear what you missed because some of your 
examples do not give the answer you say they give.

-thomas

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] ? R 2.5.0 alpha bug

2007-05-02 Thread Stefan Grosse
The version 2.5.0 has left Alpha status long time ago and its final
version has been released so please try the new version.


Inman, Brant A. M.D. wrote:
 This email is intended to highlight 2 problems that I encountered
 running R 2.5.0 alpha on a Windows XP machine.

 #1 - Open script error

 If I click the Open folder icon on the toolbar, R opens my script
 files perfectly.  However, when I select File  Open Script 
 MyFileLocation, I get a fatal error that causes R to close immediately.
 This error was reproduced on 3 consecutive occasions but has been
 intermittent thereafter. One of these fatal errors resulted in a typical
 error reporting box being generated which I sent off.  I was not able to
 verify if this error has been reported and corrected in subsequent
 versions of 2.5.

 #2 - Bug reporting link on CRAN website broken

 I tried to report the bug listed above on the CRAN website but when I
 clicked on the bug reporting link on the left-hand side panel of the
 main site (http://bugs.r-project.org/cgi-bin/R) , I get an error page
 with the following message:

 The system encountered a fatal error 
 cannot open config file /home/sfe/r-bugs/jitterbug/R : No such file or
 directory
 The last error code was: No such file or directory 
 uid/gid=30/8 


 This has been submitted to r-devel.

 Brant Inman

 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.




__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Is this a bug?

2007-04-17 Thread Weiwei Shi
one is returned value, the other one is the result from print

 t0 - ifelse(T, print(h), print(e))
[1] h
 t0
[1] h

HTH,

weiwei

On 4/17/07, Luca Braglia [EMAIL PROTECTED] wrote:
 I have found a strange ifelse behaviour (I think)

 This works:

  ifelse(T,1+1,1+2)
 [1] 2
  ifelse(F,1+1,1+2)
 [1] 3

 Maybe I missed something about R internals, but why

  ifelse(T,print(hello),print(goodbye))
 [1] hello
 [1] hello
  ifelse(F,print(hello),print(goodbye))
 [1] goodbye
 [1] goodbye

 values are returned two times? I'm not sure: if it's a bug I'll post it
 immediately

 Thank You

 Luca


 Version:
  platform = i486-pc-linux-gnu
  arch = i486
  os = linux-gnu
  system = i486, linux-gnu
  status =
  major = 2
  minor = 4.1
  year = 2006
  month = 12
  day = 18
  svn rev = 40228
  language = R
  version.string = R version 2.4.1 (2006-12-18)

 Locale:
 LC_CTYPE=it_IT.UTF-8;LC_NUMERIC=C;LC_TIME=it_IT.UTF-8;LC_COLLATE=it_IT.UTF-8;LC_MONETARY=it_IT.UTF-8;LC_MESSAGES=it_IT.UTF-8;LC_PAPER=it_IT.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=it_IT.UTF-8;LC_IDENTIFICATION=C

 Search Path:
  .GlobalEnv, package:MASS, package:utils, package:stats, package:graphics, 
 package:grDevices, package:methods, Autoloads, package:base

 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.



-- 
Weiwei Shi, Ph.D
Research Scientist
GeneGO, Inc.

Did you always know?
No, I did not. But I believed...
---Matrix III

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Is this a bug?

2007-04-17 Thread Roland Rau
On 4/17/07, Luca Braglia [EMAIL PROTECTED] wrote:

 I have found a strange ifelse behaviour (I think)


Don't you think it is rather consistent behavior?

 ifelse(T,1+1,1+2)
[1] 2
 ifelse(F,1+1,1+2)
[1] 3
 ifelse(T,hello,goodbye)
[1] hello
 ifelse(F,hello,goodbye)
[1] goodbye
 ifelse(T,print(hello),print(goodbye))
[1] hello
[1] hello
 ifelse(F,print(hello),print(goodbye))
[1] goodbye
[1] goodbye
 ifelse(T,print(1+1),print(1+2))
[1] 2
[1] 2
 ifelse(F,print(1+1),print(1+2))
[1] 3
[1] 3








This works:

  ifelse(T,1+1,1+2)
 [1] 2
  ifelse(F,1+1,1+2)
 [1] 3

 Maybe I missed something about R internals, but why

  ifelse(T,print(hello),print(goodbye))
 [1] hello
 [1] hello
  ifelse(F,print(hello),print(goodbye))
 [1] goodbye
 [1] goodbye

 values are returned two times? I'm not sure: if it's a bug I'll post it
 immediately

 Thank You

 Luca


 Version:
 platform = i486-pc-linux-gnu
 arch = i486
 os = linux-gnu
 system = i486, linux-gnu
 status =
 major = 2
 minor = 4.1
 year = 2006
 month = 12
 day = 18
 svn rev = 40228
 language = R
 version.string = R version 2.4.1 (2006-12-18)

 Locale:

 LC_CTYPE=it_IT.UTF-8;LC_NUMERIC=C;LC_TIME=it_IT.UTF-8;LC_COLLATE=it_IT.UTF-8;LC_MONETARY=it_IT.UTF-8;LC_MESSAGES=it_IT.UTF-8;LC_PAPER=it_IT.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=it_IT.UTF-8;LC_IDENTIFICATION=C

 Search Path:
 .GlobalEnv, package:MASS, package:utils, package:stats, package:graphics,
 package:grDevices, package:methods, Autoloads, package:base

 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Is this a bug?

2007-04-17 Thread Luca Braglia
On 17/04/07 -  14:59, Roland Rau wrote:
 On 4/17/07, Luca Braglia [EMAIL PROTECTED] wrote:

 ifelse(T,1+1,1+2)
 [1] 2
 ifelse(F,1+1,1+2)
 [1] 3
 ifelse(T,hello,goodbye)
 [1] hello
 ifelse(F,hello,goodbye)
 [1] goodbye
 ifelse(T,print(hello),print(goodbye))
 [1] hello
 [1] hello
 ifelse(F,print(hello),print(goodbye))
 [1] goodbye
 [1] goodbye
 ifelse(T,print(1+1),print(1+2))
 [1] 2
 [1] 2
 ifelse(F,print(1+1),print(1+2))
 [1] 3
 [1] 3



Thank you , Weiwei and Roland, all right now: I was thinking wrong!

bye

Luca

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] soil.texture() function with bug?

2006-11-24 Thread Sander Oom
Hi Patrick,

Not sure what the problem is from your email. Can you send a code
example which reproduces the error? Make sure you mention the version of
R you are using!

Also send your question/reply to/cc R-help as well. Then the rest of the
world is there to help you too.

Greetings,

Sander.

Patrick Kuss wrote:
 Dear Sander Oom and Jim Lemon,
 
 thanks for putting the soils.texture() function into R. However, for
 whatever reason I am not able to display the triangle correctly. Each of
 the 27 tick labels shows as c(10,20,30,40,50,60,70,80,90) and thus
 basically cover the whole triangle. Plotting points and adding graphical
 paramters like 'col.symbols' works fine. I am also able to plot my soil
 data using triax.plot() without any problems, but of course, the nice
 feature of soil type areas is not available.
 
 Do you have any insights?
 
 Thanks a lot and cheers from Alaska
 
 Patrick


__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Scan or read.table bug in R?

2006-11-07 Thread Duncan Murdoch
Please post general R help questions to the R-help mailing list.

The likely problem here is that your file isn't in the current working 
directory.  To avoid this problem, I often use the file.choose() 
function to obtain a full path to the file, rather than typing the name 
out myself.

Duncan Murdoch

On 11/7/2006 8:48 AM, Satya Pimputkar wrote:
 Hello R-Team,
 
  
 
 I’m a student of the University of Zurich studing Finances.
 
 I just installed R for Windows (2.4.0) on my tablet pc (windows pro tablet 
 edition).
 
 After reboot I ran the program and changed the directory to my used folder.
 
 Using a .txt file named “a.txt” and stored in the entered directory I tried 
 the function:
 
  
 
 scan(“a.txt”) and read.table(“a.txt”)
 
  
 
 Following error report encountered:
 
  
 
 scann(a.txt)
 
 Fehler in file(file, r) : kann Verbindung nicht öffnen
 
 Zusätzlich: Warning message:
 
 kann Datei 'a.txt' nicht öffnen. Grund 'No such file or directory'
 
  
 
 Where is the problem? 
 
 I tried, reinstalling, turing off virus scan/firewall, run program alone w/o 
 other applications
 behind.
 
  
 
 Please help me out, our local “R-professionals” including the doc can’t fix 
 this problem
 
 Thank you in advance!
 
  
 
 Kind regards
 
 Satya Pimputkar
 


__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Is there a bug in CrossTable (gmodels)

2006-05-02 Thread Marc Schwartz (via MN)
On Tue, 2006-05-02 at 17:21 +0200, Albert Sorribas wrote:
 Library gmodels include a function CrossTable that is useful for
 crosstabulation. In the help, it is indicated that one can call this
 function as CrossTable(data), were data is a matrix. However, when I try
 to use this option, it doesn't help. Any idea? Is there a bug?
 
 Thanks for your help.

Prof. Sorribas,

Can you please provide an example of the error and/or output you are
getting?

I am reviewing the code and think that I may see the problem, but want
to be sure that we are seeing the same thing, which may be an error such
as:

Error in cat(SpaceSep1, |, ColData, \n) :
object ColData not found


This would appear to occur when 'x' is a matrix. The code is not picking
up the second dimname for the matrix/table if present or otherwise
setting a default value for 'ColData'. It does get set if one explicitly
sets the 'dnn' argument or in the case of 'x' and 'y' being vectors.

Let me know on the above and if correct, a fix would not be difficult to
provide expediently here.

Thanks and regards,

Marc Schwartz

__
R-help@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


Re: [R] Newbie error or bug?

2006-03-13 Thread Uwe Ligges
Your error:
If you use plot(), the coordinate system of user coordinates is set up 
each time, but you do want to plot in the coordinate system of your 
first plot, hence use:


plot(time, signal, type = l, col = blue, xaxs = r, yaxs = r,
 xlab = Time (msec), ylab = Signal, main = Aliasing,
 sub = Sampling 5KHz source(blue) at 8KHz (dots)
gives 2.5KHz alias(red))
lines(time, alias, lty=2, col=red)
points(undersamplingtimes, undersampled, pch=16)
abline(h=0)



Uwe Ligges




Paul Vickers wrote:
 Hi
 
 I used R for the first time yesterday. I wanted to plot the aliasing
 effect of sampling a 5.5KHz sinusoid at only 8KHz (below the Nyquist
 limit). So I wrote a small R script that a) plots 1msec worth of a
 5.5KHz sin wave b) plots 1msec of the resulting 2.5KHz alias and c)
 plots the 8 sampling points on the 5.5KHz source wave. I think I have
 found a bug. The script is as follows:
 
 #truesamplingfreq - 1000*5.5
 freqin1msec = 5.5
 #aliassamplingfreq - 1000*2.5
 aliasfreqin1msec = 2.5
 
 drawingpoints = 1
 time = (0:drawingpoints)/drawingpoints
 
 signal = sin(freqin1msec*2*pi*(time))
 alias = -sin(aliasfreqin1msec*2*pi*(time))
 
 
 undersamplinginterval = max(time)/8
 seq (0, max(time), by=undersamplinginterval) - undersamplingtimes
 undersampled = sin(freqin1msec*2*pi*undersamplingtimes)
 
 plot(time,signal,type=l, col=blue, xaxs=r, yaxs=r, xlab=Time
 (msec), ylab=Signal, main=Aliasing, sub=Sampling 5KHz source
 (blue) at 8KHz (dots) gives 2.5KHz alias(red))
 par(new=TRUE)
 plot (time, alias, xaxs=r,  yaxs=r, type=l, lty=2, col=red,
 axes=FALSE, xlab=, ylab=)
 par(new=TRUE)
 plot(undersamplingtimes, undersampled, pch=16,  xaxs=r, yaxs=r,
 axes=FALSE, xlab=, ylab=, abline(h=0))
 
 The output is given as attachment alias.jpg in which the line through
 y=0 is offset and all the positive sampling points (black dots) are also
 offset (interestingly, all the negative points seem to be correct). All
 the black dots should line up with 8 intersections of the red and blue
 lines. I don't think the script is wrong because if I double everything
 up and plot an 11KHz source, its 5KHz alias and 16 sampling points (for
 16KHz sampling) everything works as expected (see attachment alias2.jpg)
 - ie, the line through y=0 is in the right place as are the 16 sampling
 points.
 
 Here's my sessionInfo:
 R version 2.2.1, 2005-12-20, powerpc-apple-darwin7.9.0
 
 attached base packages:
 [1] methods   stats graphics  grDevices utils
 [6] datasets  base
 
 I'm running OS X 10.4.5
 
 Can anyone enlighten me?
 
 Cheers
 
 Paul
 
 
 
 
 __
 R-help@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@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


Re: [R] Newbie error or bug?

2006-03-13 Thread Paul Vickers
That also works and is even more concise.Many thanks,

Paul

Uwe Ligges wrote:
 Your error:
 If you use plot(), the coordinate system of user coordinates is set up 
 each time, but you do want to plot in the coordinate system of your 
 first plot, hence use:
 
 
 plot(time, signal, type = l, col = blue, xaxs = r, yaxs = r,
 xlab = Time (msec), ylab = Signal, main = Aliasing,
 sub = Sampling 5KHz source(blue) at 8KHz (dots)
gives 2.5KHz alias(red))
 lines(time, alias, lty=2, col=red)
 points(undersamplingtimes, undersampled, pch=16)
 abline(h=0)
 
 
 
 Uwe Ligges
 
 
 
 
 Paul Vickers wrote:
 Hi

 I used R for the first time yesterday. I wanted to plot the aliasing
 effect of sampling a 5.5KHz sinusoid at only 8KHz (below the Nyquist
 limit). So I wrote a small R script that a) plots 1msec worth of a
 5.5KHz sin wave b) plots 1msec of the resulting 2.5KHz alias and c)
 plots the 8 sampling points on the 5.5KHz source wave. I think I have
 found a bug. The script is as follows:

 #truesamplingfreq - 1000*5.5
 freqin1msec = 5.5
 #aliassamplingfreq - 1000*2.5
 aliasfreqin1msec = 2.5

 drawingpoints = 1
 time = (0:drawingpoints)/drawingpoints

 signal = sin(freqin1msec*2*pi*(time))
 alias = -sin(aliasfreqin1msec*2*pi*(time))


 undersamplinginterval = max(time)/8
 seq (0, max(time), by=undersamplinginterval) - undersamplingtimes
 undersampled = sin(freqin1msec*2*pi*undersamplingtimes)

 plot(time,signal,type=l, col=blue, xaxs=r, yaxs=r, xlab=Time
 (msec), ylab=Signal, main=Aliasing, sub=Sampling 5KHz source
 (blue) at 8KHz (dots) gives 2.5KHz alias(red))
 par(new=TRUE)
 plot (time, alias, xaxs=r,  yaxs=r, type=l, lty=2, col=red,
 axes=FALSE, xlab=, ylab=)
 par(new=TRUE)
 plot(undersamplingtimes, undersampled, pch=16,  xaxs=r, yaxs=r,
 axes=FALSE, xlab=, ylab=, abline(h=0))

 The output is given as attachment alias.jpg in which the line through
 y=0 is offset and all the positive sampling points (black dots) are also
 offset (interestingly, all the negative points seem to be correct). All
 the black dots should line up with 8 intersections of the red and blue
 lines. I don't think the script is wrong because if I double everything
 up and plot an 11KHz source, its 5KHz alias and 16 sampling points (for
 16KHz sampling) everything works as expected (see attachment alias2.jpg)
 - ie, the line through y=0 is in the right place as are the 16 sampling
 points.

 Here's my sessionInfo:
 R version 2.2.1, 2005-12-20, powerpc-apple-darwin7.9.0

 attached base packages:
 [1] methods   stats graphics  grDevices utils
 [6] datasets  base

 I'm running OS X 10.4.5

 Can anyone enlighten me?

 Cheers

 Paul


 

 __
 R-help@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
 
 

-- 

Dr P. Vickers BSc PhD CEng MIEE ILTM
Reader in Human-Computer Interaction 
Visiting Research Fellow of Loughborough University

School of Computing, Engineering,  Information Sciences
Northumbria University
Pandon Building, Camden Street
Newcastle-upon-Tyne
NE2 1XE

Tel +44 (0)191 243-7614
Fax +44 (0)870 133-9127
e-mail: [EMAIL PROTECTED]
web: www.paulvickers.com/northumbria

Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of
Northumbria University.



This e-mail is intended solely for the addressee. It may contain private
and confidential information. If you are not the intended addressee,
please take no action based on it nor show a copy to anyone. Please
reply to this e-mail to highlight the error. You should also be aware
that all electronic mail from, to, or within Northumbria University may
be the subject of a request under the Freedom of Information Act 2000
and related legislation, and therefore may be required to be disclosed
to third parties.

This e-mail and attachments have been scanned for viruses prior to
leaving Northumbria University. Northumbria University will not be
liable for any losses as a result of any viruses being passed on.

__
R-help@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


Re: [R] Potential minor GUI bug

2005-06-17 Thread Francisco J. Zagmutt

Dear Any

Thanks for your response.  Maybe I did not explain the behavior well.  I am 
aware that the Not Responding is a windows default.  What I was trying to 
explain is that once the process that generated the Not Responding is 
finished and I can use R for othe computations the Not Responding caption 
will remain in the task bar icon but not in the caption on the main Gui 
form.  Please see the attached screen caption for an example.


Regards

Francisco




From: Liaw, Andy [EMAIL PROTECTED]
To: 'Francisco J. Zagmutt' 
[EMAIL PROTECTED],R-help@stat.math.ethz.ch

Subject: RE: [R] Potential minor GUI bug
Date: Thu, 16 Jun 2005 17:26:03 -0400

I don't think that's a bug.  Almost every Windows application can do that:
when it's busy with computation, you'll see the not responding message.

Andy

 From: Francisco J. Zagmutt

 Is this an interface bug?  Using RGUI for windows I run into a Not
 Responding process (I smartly coded an infinite loop,
 yaiks!), I hit esc
 and the interpreter was stopped and I recovered the console
 functionality
 but the caption on the R icon in my windows taskbar (the
 individual icon
 shown for every software currently running in the session)
 was not updated
 so the caption still reads RGui (Not Responding). This behavior is
 repeated everytime I run into a Not responding process.
 Off course if I
 end the session and open a new session the icon caption goes
 back to the
 normal RGui.

 I am running R2.1.0 on Windows XP Pro V. 2002 SP2, Pentium M,
 1.00 Gb Ram.

 Cheers

 Francisco

 __
 R-help@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






--
Notice:  This e-mail message, together with any attachments, contains 
information of Merck  Co., Inc. (One Merck Drive, Whitehouse Station, New 
Jersey, USA 08889), and/or its affiliates (which may be known outside the 
United States as Merck Frosst, Merck Sharp  Dohme or MSD and in Japan, as 
Banyu) that may be confidential, proprietary copyrighted and/or legally 
privileged. It is intended solely for the use of the individual or entity 
named on this message.  If you are not the intended recipient, and have 
received this message in error, please notify us immediately by reply 
e-mail and then delete it from your system.

--


__
R-help@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

Re: [R] Potential minor GUI bug

2005-06-17 Thread Liaw, Andy
Now I understand.  I get the same thing in SDI mode (R-2.1.0 on WinXPPro).
No idea why...

Andy

 From: Francisco J. Zagmutt 
 
 Dear Any
 
 Thanks for your response.  Maybe I did not explain the 
 behavior well.  I am 
 aware that the Not Responding is a windows default.  What I 
 was trying to 
 explain is that once the process that generated the Not Responding is 
 finished and I can use R for othe computations the Not 
 Responding caption 
 will remain in the task bar icon but not in the caption on 
 the main Gui 
 form.  Please see the attached screen caption for an example.
 
 Regards
 
 Francisco
 
 
 
 From: Liaw, Andy [EMAIL PROTECTED]
 To: 'Francisco J. Zagmutt' 
 [EMAIL PROTECTED],R-help@stat.math.ethz.ch
 Subject: RE: [R] Potential minor GUI bug
 Date: Thu, 16 Jun 2005 17:26:03 -0400
 
 I don't think that's a bug.  Almost every Windows 
 application can do that:
 when it's busy with computation, you'll see the not 
 responding message.
 
 Andy
 
   From: Francisco J. Zagmutt
  
   Is this an interface bug?  Using RGUI for windows I run 
 into a Not
   Responding process (I smartly coded an infinite loop,
   yaiks!), I hit esc
   and the interpreter was stopped and I recovered the console
   functionality
   but the caption on the R icon in my windows taskbar (the
   individual icon
   shown for every software currently running in the session)
   was not updated
   so the caption still reads RGui (Not Responding). This 
 behavior is
   repeated everytime I run into a Not responding process.
   Off course if I
   end the session and open a new session the icon caption goes
   back to the
   normal RGui.
  
   I am running R2.1.0 on Windows XP Pro V. 2002 SP2, Pentium M,
   1.00 Gb Ram.
  
   Cheers
  
   Francisco
  
   __
   R-help@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
  
  
  
 
 
 
 -
 -
 Notice:  This e-mail message, together with any attachments, 
 contains 
 information of Merck  Co., Inc. (One Merck Drive, 
 Whitehouse Station, New 
 Jersey, USA 08889), and/or its affiliates (which may be 
 known outside the 
 United States as Merck Frosst, Merck Sharp  Dohme or MSD 
 and in Japan, as 
 Banyu) that may be confidential, proprietary copyrighted 
 and/or legally 
 privileged. It is intended solely for the use of the 
 individual or entity 
 named on this message.  If you are not the intended 
 recipient, and have 
 received this message in error, please notify us immediately 
 by reply 
 e-mail and then delete it from your system.
 -
 -
 


__
R-help@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


Re: [R] Potential minor GUI bug

2005-06-17 Thread Uwe Ligges
Liaw, Andy wrote:

 Now I understand.  I get the same thing in SDI mode (R-2.1.0 on WinXPPro).
 No idea why...

I guess this is a Windows bug, because I have seen it in other 
applications as well. Hence I don't think we should waste our time here ...

Uwe Ligges



 
 Andy
 
 
From: Francisco J. Zagmutt 

Dear Any

Thanks for your response.  Maybe I did not explain the 
behavior well.  I am 
aware that the Not Responding is a windows default.  What I 
was trying to 
explain is that once the process that generated the Not Responding is 
finished and I can use R for othe computations the Not 
Responding caption 
will remain in the task bar icon but not in the caption on 
the main Gui 
form.  Please see the attached screen caption for an example.

Regards

Francisco




From: Liaw, Andy [EMAIL PROTECTED]
To: 'Francisco J. Zagmutt' 
[EMAIL PROTECTED],R-help@stat.math.ethz.ch
Subject: RE: [R] Potential minor GUI bug
Date: Thu, 16 Jun 2005 17:26:03 -0400

I don't think that's a bug.  Almost every Windows 

application can do that:

when it's busy with computation, you'll see the not 

responding message.

Andy


From: Francisco J. Zagmutt

Is this an interface bug?  Using RGUI for windows I run 

into a Not

Responding process (I smartly coded an infinite loop,
yaiks!), I hit esc
and the interpreter was stopped and I recovered the console
functionality
but the caption on the R icon in my windows taskbar (the
individual icon
shown for every software currently running in the session)
was not updated
so the caption still reads RGui (Not Responding). This 

behavior is

repeated everytime I run into a Not responding process.
Off course if I
end the session and open a new session the icon caption goes
back to the
normal RGui.

I am running R2.1.0 on Windows XP Pro V. 2002 SP2, Pentium M,
1.00 Gb Ram.

Cheers

Francisco

__
R-help@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






-

-

Notice:  This e-mail message, together with any attachments, 

contains 

information of Merck  Co., Inc. (One Merck Drive, 

Whitehouse Station, New 

Jersey, USA 08889), and/or its affiliates (which may be 

known outside the 

United States as Merck Frosst, Merck Sharp  Dohme or MSD 

and in Japan, as 

Banyu) that may be confidential, proprietary copyrighted 

and/or legally 

privileged. It is intended solely for the use of the 

individual or entity 

named on this message.  If you are not the intended 

recipient, and have 

received this message in error, please notify us immediately 

by reply 

e-mail and then delete it from your system.
-

-


 
 
 __
 R-help@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@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


Re: [R] Potential minor GUI bug

2005-06-17 Thread Francisco J. Zagmutt
Dear Uwe

I have not seen this behavior in other windows applications but I 
definitivelly agree with you that it is probably not worth spending time on 
this trivial issue.

Thanks

Francisco


From: Uwe Ligges [EMAIL PROTECTED]
To: Liaw, Andy [EMAIL PROTECTED]
CC: 'Francisco J. Zagmutt' 
[EMAIL PROTECTED],R-help@stat.math.ethz.ch
Subject: Re: [R] Potential minor GUI bug
Date: Fri, 17 Jun 2005 08:21:05 +0200

Liaw, Andy wrote:

Now I understand.  I get the same thing in SDI mode (R-2.1.0 on WinXPPro).
No idea why...

I guess this is a Windows bug, because I have seen it in other applications 
as well. Hence I don't think we should waste our time here ...

Uwe Ligges




Andy


From: Francisco J. Zagmutt

Dear Any

Thanks for your response.  Maybe I did not explain the behavior well.  I 
am aware that the Not Responding is a windows default.  What I was 
trying to explain is that once the process that generated the Not 
Responding is finished and I can use R for othe computations the Not 
Responding caption will remain in the task bar icon but not in the 
caption on the main Gui form.  Please see the attached screen caption for 
an example.

Regards

Francisco




From: Liaw, Andy [EMAIL PROTECTED]
To: 'Francisco J. Zagmutt' 
[EMAIL PROTECTED],R-help@stat.math.ethz.ch
Subject: RE: [R] Potential minor GUI bug
Date: Thu, 16 Jun 2005 17:26:03 -0400

I don't think that's a bug.  Almost every Windows

application can do that:

when it's busy with computation, you'll see the not

responding message.

Andy


From: Francisco J. Zagmutt

Is this an interface bug?  Using RGUI for windows I run

into a Not

Responding process (I smartly coded an infinite loop,
yaiks!), I hit esc
and the interpreter was stopped and I recovered the console
functionality
but the caption on the R icon in my windows taskbar (the
individual icon
shown for every software currently running in the session)
was not updated
so the caption still reads RGui (Not Responding). This

behavior is

repeated everytime I run into a Not responding process.
Off course if I
end the session and open a new session the icon caption goes
back to the
normal RGui.

I am running R2.1.0 on Windows XP Pro V. 2002 SP2, Pentium M,
1.00 Gb Ram.

Cheers

Francisco

__
R-help@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






-

-

Notice:  This e-mail message, together with any attachments,

contains

information of Merck  Co., Inc. (One Merck Drive,

Whitehouse Station, New

Jersey, USA 08889), and/or its affiliates (which may be

known outside the

United States as Merck Frosst, Merck Sharp  Dohme or MSD

and in Japan, as

Banyu) that may be confidential, proprietary copyrighted

and/or legally

privileged. It is intended solely for the use of the

individual or entity

named on this message.  If you are not the intended

recipient, and have

received this message in error, please notify us immediately

by reply

e-mail and then delete it from your system.
-

-




__
R-help@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@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


Re: [R] Potential minor GUI bug

2005-06-17 Thread Prof Brian Ripley
Yes, it is a Windows bug: the frame is controlled by Windows and not by R.

On Fri, 17 Jun 2005, Uwe Ligges wrote:

 Liaw, Andy wrote:

 Now I understand.  I get the same thing in SDI mode (R-2.1.0 on WinXPPro).
 No idea why...

 I guess this is a Windows bug, because I have seen it in other
 applications as well. Hence I don't think we should waste our time here ...

 Uwe Ligges




 Andy


 From: Francisco J. Zagmutt

 Dear Any

 Thanks for your response.  Maybe I did not explain the
 behavior well.  I am
 aware that the Not Responding is a windows default.  What I
 was trying to
 explain is that once the process that generated the Not Responding is
 finished and I can use R for othe computations the Not
 Responding caption
 will remain in the task bar icon but not in the caption on
 the main Gui
 form.  Please see the attached screen caption for an example.

 Regards

 Francisco




 From: Liaw, Andy [EMAIL PROTECTED]
 To: 'Francisco J. Zagmutt'
 [EMAIL PROTECTED],R-help@stat.math.ethz.ch
 Subject: RE: [R] Potential minor GUI bug
 Date: Thu, 16 Jun 2005 17:26:03 -0400

 I don't think that's a bug.  Almost every Windows

 application can do that:

 when it's busy with computation, you'll see the not

 responding message.

 Andy


 From: Francisco J. Zagmutt

 Is this an interface bug?  Using RGUI for windows I run

 into a Not

 Responding process (I smartly coded an infinite loop,
 yaiks!), I hit esc
 and the interpreter was stopped and I recovered the console
 functionality
 but the caption on the R icon in my windows taskbar (the
 individual icon
 shown for every software currently running in the session)
 was not updated
 so the caption still reads RGui (Not Responding). This

 behavior is

 repeated everytime I run into a Not responding process.
 Off course if I
 end the session and open a new session the icon caption goes
 back to the
 normal RGui.

 I am running R2.1.0 on Windows XP Pro V. 2002 SP2, Pentium M,
 1.00 Gb Ram.

 Cheers

 Francisco

 __
 R-help@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






 -

 -

 Notice:  This e-mail message, together with any attachments,

 contains

 information of Merck  Co., Inc. (One Merck Drive,

 Whitehouse Station, New

 Jersey, USA 08889), and/or its affiliates (which may be

 known outside the

 United States as Merck Frosst, Merck Sharp  Dohme or MSD

 and in Japan, as

 Banyu) that may be confidential, proprietary copyrighted

 and/or legally

 privileged. It is intended solely for the use of the

 individual or entity

 named on this message.  If you are not the intended

 recipient, and have

 received this message in error, please notify us immediately

 by reply

 e-mail and then delete it from your system.
 -

 -




 __
 R-help@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@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,  [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-help@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


Re: [R] Potential minor GUI bug

2005-06-16 Thread Liaw, Andy
I don't think that's a bug.  Almost every Windows application can do that:
when it's busy with computation, you'll see the not responding message.

Andy

 From: Francisco J. Zagmutt
 
 Is this an interface bug?  Using RGUI for windows I run into a Not 
 Responding process (I smartly coded an infinite loop, 
 yaiks!), I hit esc 
 and the interpreter was stopped and I recovered the console 
 functionality 
 but the caption on the R icon in my windows taskbar (the 
 individual icon 
 shown for every software currently running in the session)  
 was not updated 
 so the caption still reads RGui (Not Responding). This behavior is 
 repeated everytime I run into a Not responding process.  
 Off course if I 
 end the session and open a new session the icon caption goes 
 back to the 
 normal RGui.
 
 I am running R2.1.0 on Windows XP Pro V. 2002 SP2, Pentium M, 
 1.00 Gb Ram.
 
 Cheers
 
 Francisco
 
 __
 R-help@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@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


RE: [R] Help with possible bug (assigning NA value to data.frame) ?

2005-06-07 Thread Liaw, Andy
There's something peculiar that I do not understand here.  However, did you
realize that the thing you are assigning into parts of `a' is NULL?  Check
you're my.test.boot.ci.1:  It's NULL.

Be that as it may, I get:

 a - data.frame(matrix(1:4, nrow=2), X3=NA, X4=NA)
 a
  X1 X2 X3 X4
1  1  3 NA NA
2  2  4 NA NA
 a[a$X1 == 1,]$X3 - NULL
 a
  X1 X2 X3 X4
1  1  3 NA  1
2  2  4 NA NA
 a[a$X1 == 1,]$X4 - NULL
 a
  X1 X2 X3 X4
1  1  3 NA  1
2  2  4 NA NA

which really baffles me...

In any case, that's not how I would assign into part of a data frame.  I
would do either

a[a$X1 == 1, X3] - something

or

a$X3[a$X1 == 1] - something

In either case you'd get an error if `something' is NULL.

Andy

 From: Dan Bolser
 
 
 This 'strange behaviour' manifest itself within some quite complex
 code. When I created a *very* simple example the behaviour 
 dissapeared. 
 
 Here is the simplest version I have found which still causes 
 the strange
 behaviour (it could be quite unrelated to the boot library, however).
 
 
 library(boot)
  
 ## boot statistic function
 my.mean.s - function(data,subset){
   mean(data[subset])
 }
 
 ## dummy data, deliberatly no variance
 my.test.dat.1 - rep(4,5)
 my.test.dat.2 - rep(8,5)
 
 ## not much can happen here
 my.test.boot.1 - boot( my.test.dat.1, my.mean.s, R=10 )
 my.test.boot.2 - boot( my.test.dat.2, my.mean.s, R=10 )
 
 ## returns a null object as ci is meaningless for this data
 my.test.boot.ci.1 - boot.ci(my.test.boot.1,type='normal')
 my.test.boot.ci.2 - boot.ci(my.test.boot.2,type='normal')
 
 
 ## now try to store this data (the problem begins)...
 
 ## dummy existing data 
 a - data.frame(matrix(c(1,2,3,4),nrow=2))
 
 ## make space for new data
 a$X3 - NA
 a$X4 - NA
 
 ## try to store the upper and lower ci (not) calculated above
 a[a$X1==1,]$X3 -  my.test.boot.ci.1$normal[2]
 a[a$X1==1,]$X4 -  my.test.boot.ci.1$normal[3]
 a[a$X1==2,]$X3 -  my.test.boot.ci.1$normal[2]
 a[a$X1==2,]$X4 -  my.test.boot.ci.1$normal[3]
 
 a
 
 
 What I see is 
 
  a
   X1 X2 X3 X4
 1  1  3 NA  1
 2  2  4 NA  2
 
 
 What I expected to see was
 
  a
   X1 X2 X3 X4
 1  1  3 NA  NA
 2  2  4 NA  NA
 
 Some how the last assignment of the data from within the null object
 assigns the value of the '==x' part of the logical vector subscript.
 
 If I make the following (trivial?) adjustment 
 
 a[a$X1==1,]$X4 -  my.test.boot.ci.1$normal[3]
 a[a$X1==1,]$X3 -  my.test.boot.ci.a$normal[2]
 a[a$X1==2,]$X4 -  my.test.boot.ci.1$normal[3]
 a[a$X1==2,]$X3 -  my.test.boot.ci.1$normal[2]
 
 
 The output changes to 
 
  a
   X1 X2 X3 X4
 1  1  3  1  1
 2  2  4  2  2
 
 Which is even wronger.
 
 
 
 Not sure if this is usefull without the full context, but here is the
 output from the real version of this program (where most of 
 the above code
 is within a loop). What is printed out for each cycle of the 
 loop is the
 value of the '==x' part of the subscript.
 
 
 [1] 2
 [1] 3
 [1] 4
 [1] 5
 [1] All values of t are equal to  1 \n Cannot calculate confidence
 intervals
 [1] 6
 [1] 7
 [1] All values of t are equal to  1 \n Cannot calculate confidence
 intervals
 [1] 8
 [1] 10
 [1] 11
 [1] All values of t are equal to  1 \n Cannot calculate confidence
 intervals
  
 
 
 Above you see that for some values I can't calculate a ci 
 (but storing it
 as above), then...
 
  dat.5.ho
   CHAINS DOM_PER_CHAIN lower upper
 1  2  1.416539 1.3626253  1.468387
 2  3  1.20 1.1146014  1.288724
 3  4  1.363636 1.2675657  1.462571
 4  5  1.00NA  5.00
 5  6  1.323529 1.0991974  1.546156
 6  7  1.00NA  7.00
 7  8  1.10 0.9037904  1.289210
 8 10  1.142857 0.8775104  1.403918
 9 11  1.00NA 11.00
  
 
 
 Do you spot the same problem? Namely for each value of the 
 'CHAINS' column
 that was unable to calculate a ci, the second assignment to 
 the data table
 from the 'null' object assigned the lookup value of CHAINS to 
 that column
 instead! The assignment (within the loop) looks like this...
 
   dat.5.ho[dat.5.ho$CHAINS==chain,]$lower -  x.s.ci$normal[2]
   dat.5.ho[dat.5.ho$CHAINS==chain,]$upper -  x.s.ci$normal[3]
 
 (where chain is the 'loop variable').
 
 
 As far as I can tell this is a bug. It dosn't happen when I try...
  
   dat.5.ho[dat.5.ho$CHAINS==chain,]$lower -  NA
   dat.5.ho[dat.5.ho$CHAINS==chain,]$upper -  NA 
 
 
 And doing the following (swapping the order) changes the behaviour...
 
   dat.5.ho[dat.5.ho$CHAINS==chain,]$upper -  x.s.ci$normal[3]
   dat.5.ho[dat.5.ho$CHAINS==chain,]$lower -  x.s.ci$normal[2]
   
 
 Giving...
 
  dat.5.ho
   CHAINS DOM_PER_CHAIN  lower upper
 1  2  1.416539  1.3616070  1.472716
 2  3  1.20  1.1134237  1.287601
 3  4  1.363636  1.2587204  1.466037
 4  5  1.00  5.000  5.00
 5  6  1.323529  1.1082482  1.547222
 6  7  1.00  7.000  7.00
 7  8  1.10  

Re: [R] Help with possible bug (assigning NA value to data.frame) ?

2005-06-07 Thread James Reilly
This seems to have more to do with NULLs than NAs. For instance:
 a - data.frame(matrix(1:8, nrow=2))
 a
  X1 X2 X3 X4
1  1  3  5  7
2  2  4  6  8
 a[a$X2 == 4,]$X1 - NULL
 a
  X1 X2 X3 X4
1  1  3  5  7
2  4  6  8  4

James

On 8/06/2005 7:15 a.m., Liaw, Andy wrote:
 There's something peculiar that I do not understand here.  However, did you
 realize that the thing you are assigning into parts of `a' is NULL?  Check
 you're my.test.boot.ci.1:  It's NULL.
 
 Be that as it may, I get:
 
 
a - data.frame(matrix(1:4, nrow=2), X3=NA, X4=NA)
a
 
   X1 X2 X3 X4
 1  1  3 NA NA
 2  2  4 NA NA
 
a[a$X1 == 1,]$X3 - NULL
a
 
   X1 X2 X3 X4
 1  1  3 NA  1
 2  2  4 NA NA
 
a[a$X1 == 1,]$X4 - NULL
a
 
   X1 X2 X3 X4
 1  1  3 NA  1
 2  2  4 NA NA
 
 which really baffles me...
 
 In any case, that's not how I would assign into part of a data frame.  I
 would do either
 
 a[a$X1 == 1, X3] - something
 
 or
 
 a$X3[a$X1 == 1] - something
 
 In either case you'd get an error if `something' is NULL.
 
 Andy
 
 
From: Dan Bolser


This 'strange behaviour' manifest itself within some quite complex
code. When I created a *very* simple example the behaviour 
dissapeared. 

Here is the simplest version I have found which still causes 
the strange
behaviour (it could be quite unrelated to the boot library, however).


library(boot)
 
## boot statistic function
my.mean.s - function(data,subset){
  mean(data[subset])
}

## dummy data, deliberatly no variance
my.test.dat.1 - rep(4,5)
my.test.dat.2 - rep(8,5)

## not much can happen here
my.test.boot.1 - boot( my.test.dat.1, my.mean.s, R=10 )
my.test.boot.2 - boot( my.test.dat.2, my.mean.s, R=10 )

## returns a null object as ci is meaningless for this data
my.test.boot.ci.1 - boot.ci(my.test.boot.1,type='normal')
my.test.boot.ci.2 - boot.ci(my.test.boot.2,type='normal')


## now try to store this data (the problem begins)...

## dummy existing data 
a - data.frame(matrix(c(1,2,3,4),nrow=2))

## make space for new data
a$X3 - NA
a$X4 - NA

## try to store the upper and lower ci (not) calculated above
a[a$X1==1,]$X3 -  my.test.boot.ci.1$normal[2]
a[a$X1==1,]$X4 -  my.test.boot.ci.1$normal[3]
a[a$X1==2,]$X3 -  my.test.boot.ci.1$normal[2]
a[a$X1==2,]$X4 -  my.test.boot.ci.1$normal[3]

a


What I see is 


a

  X1 X2 X3 X4
1  1  3 NA  1
2  2  4 NA  2


What I expected to see was


a

  X1 X2 X3 X4
1  1  3 NA  NA
2  2  4 NA  NA

Some how the last assignment of the data from within the null object
assigns the value of the '==x' part of the logical vector subscript.

If I make the following (trivial?) adjustment 

a[a$X1==1,]$X4 -  my.test.boot.ci.1$normal[3]
a[a$X1==1,]$X3 -  my.test.boot.ci.a$normal[2]
a[a$X1==2,]$X4 -  my.test.boot.ci.1$normal[3]
a[a$X1==2,]$X3 -  my.test.boot.ci.1$normal[2]


The output changes to 


a

  X1 X2 X3 X4
1  1  3  1  1
2  2  4  2  2

Which is even wronger.



Not sure if this is usefull without the full context, but here is the
output from the real version of this program (where most of 
the above code
is within a loop). What is printed out for each cycle of the 
loop is the
value of the '==x' part of the subscript.


[1] 2
[1] 3
[1] 4
[1] 5
[1] All values of t are equal to  1 \n Cannot calculate confidence
intervals
[1] 6
[1] 7
[1] All values of t are equal to  1 \n Cannot calculate confidence
intervals
[1] 8
[1] 10
[1] 11
[1] All values of t are equal to  1 \n Cannot calculate confidence
intervals


Above you see that for some values I can't calculate a ci 
(but storing it
as above), then...


dat.5.ho

  CHAINS DOM_PER_CHAIN lower upper
1  2  1.416539 1.3626253  1.468387
2  3  1.20 1.1146014  1.288724
3  4  1.363636 1.2675657  1.462571
4  5  1.00NA  5.00
5  6  1.323529 1.0991974  1.546156
6  7  1.00NA  7.00
7  8  1.10 0.9037904  1.289210
8 10  1.142857 0.8775104  1.403918
9 11  1.00NA 11.00


Do you spot the same problem? Namely for each value of the 
'CHAINS' column
that was unable to calculate a ci, the second assignment to 
the data table
from the 'null' object assigned the lookup value of CHAINS to 
that column
instead! The assignment (within the loop) looks like this...

  dat.5.ho[dat.5.ho$CHAINS==chain,]$lower -  x.s.ci$normal[2]
  dat.5.ho[dat.5.ho$CHAINS==chain,]$upper -  x.s.ci$normal[3]

(where chain is the 'loop variable').


As far as I can tell this is a bug. It dosn't happen when I try...
 
  dat.5.ho[dat.5.ho$CHAINS==chain,]$lower -  NA
  dat.5.ho[dat.5.ho$CHAINS==chain,]$upper -  NA 


And doing the following (swapping the order) changes the behaviour...

  dat.5.ho[dat.5.ho$CHAINS==chain,]$upper -  x.s.ci$normal[3]
  dat.5.ho[dat.5.ho$CHAINS==chain,]$lower -  x.s.ci$normal[2]
  

Giving...


dat.5.ho

  CHAINS DOM_PER_CHAIN  lower upper
1  2  1.416539  1.3616070  1.472716
2  3  1.20  1.1134237  1.287601
3  4  1.363636  1.2587204  1.466037
4  5  1.00  

Re: [R] glob2rx() {was: no bug in R2.1.0's list.files()}

2005-05-12 Thread Gabor Grothendieck
I think glob2rx is of sufficient interest and sufficiently small
that it would be nice to have in the core of R without having to 
install and load sfsmisc.

On 5/12/05, Martin Maechler [EMAIL PROTECTED] wrote:
  BaRow == Barry Rowlingson [EMAIL PROTECTED]
  on Thu, 12 May 2005 11:05:43 +0100 writes:
 
BaRow Uwe Ligges wrote:
 Please read about regular expressions (!!!) and try to
 understand that .txt also finds Not_a_txt_file.xls
 
 
BaRow   The confusion here is between regular expressions
BaRow and wildcard expansion known as 'globbing'. The two
BaRow things are very different, and use characters such as
BaRow '*' '.' and '?' in different ways.
 
 Exactly,  I had devised  a  glob to regexp function many
 years ago in order to help newbies make the transition.
 
 That function, nowadays, called 'glob2rx' has been part of our
 (CRAN) package sfsmisc and hence available to all via
 
   install.packages(sfsmisc)
   library(sfsmisc)
 
 But it's quite simple (though not trivial to read for the
 inexperienced because of the many escapes (\) needed)
 and it maybe helpful to see its code on R-help, below.
 Then, this topic has lead me to add 2 (obvious in hindsight)
 logical optional arguments to the function so that it now looks like
 
 glob2rx - function(pattern, trim.head = FALSE, trim.tail = TRUE)
 {
## Purpose: Change ls aka wildcard aka globbing _pattern_ to
##Regular Expression (as in grep, perl, emacs, ...)
## 
 -
## Author: Martin Maechler ETH Zurich, ~ 1991
## New version using [g]sub() : 2004
p - gsub('\\.','.', paste('^', pattern, '$', sep=''))
p - gsub('\\?', '.',  gsub('\\*',  '.*', p))
## these are trimming '.*$' and '^.*' - in most cases only for esthetics
if(trim.tail) p - sub(\\.\\*\\$$, '', p)
if(trim.head) p - sub(\\^\\.\\*,  '', p)
p
 }
 
 So those confused newbies (and DOS long timers!)
 could use
 
  list.files(myloc, glob2rx(*.zip), full=TRUE)
 
## (yes, make a habit of using 'TRUE', not 'T' ..)
 
 The current example code, BTW, has
 
stopifnot(glob2rx(abc.*) == ^abc\\.,
   glob2rx(a?b.*) == ^a.b\\.,
   glob2rx(a?b.*, trim.tail=FALSE) == ^a.b\\..*$,
   glob2rx(*.doc) == ^.*\\.doc$,
   glob2rx(*.doc, trim.head=TRUE) == \\.doc$,
   glob2rx(*.t*)  == ^.*\\.t,
   glob2rx(*.t??) == ^.*\\.t..$
 )
 
 Martin Maechler,
 ETH Zurich
 
BaRow   There's added confusion when people come from a DOS
BaRow background, where commands did their own thing when
BaRow given '*' as parameter. The DOS command:
 
BaRow   RENAME *.FOO *.BAR
 
BaRow   did what seems obvious, renaming all the .FOO files
BaRow to .BAR, but on a unix machine doing this with 'mv'
BaRow can be destructive!
 
BaRow   In short (and slightly simplified), a '*' when
BaRow expanded as a wildcard in a glob matches any string,
BaRow whereas a '*' in a regular expression (regexp),
BaRow matches the previous character 0 or more times. This
BaRow is why *.zip is flagged as invalid now - there's no
BaRow character before the *.
 
BaRow   That should be enough clues to send you on your
BaRow way.
 
BaRow   Baz
 
 __
 R-help@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@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


Re: [R] Is this a bug in R?

2005-04-27 Thread Prof Brian Ripley
You are in fact using the contributed package 'nlme', not just R.
Please read both the section on BUGS in the FAQ and the posting guide, and 
send a reproducible example to the nlme maintainer.

One thing the posting guide asks for is a useful subject line.  Something 
like

`A crash when using nlme'.
On Thu, 28 Apr 2005, Revilla,AJ  (pgt) wrote:
Dear all,
I am trying to fit a nonlinear model with a autocorrelation term, but everytime 
I type in the command, I got an error message from Winwows and R closes itself.
The command line is as follows:
mod1-nlme(V~A*exp(-B*A.O)*Vac.t.1.,data,fixed=A+B~1,random=A+B~1|ORDINAL,+
correlation=corCAR1(0.3179,~A.O|ORDINAL,TRUE),start=c(A=1.2,B=0.2))
I have already fitted this model allowing Phi to vary while optimizing, and it was fine, 
but as soon as I try to keep it fixed (argument TRUE), I simply can't
I don't get any error message from R, just a Windows error seying something like R 
for windows GUI front-end has detected a problem and has to close. And that´s it, R 
is over!
I don't know if I am doing anything wrong, or if it has to be with my system (I 
have Windows XP Pro), but it looks like a bug in R.
Do you know anything else about this. Thank you very much,
Antonio
--
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-help@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

Re: [R] Lattice cloud() funtion bug in R1.8.0beta

2003-10-09 Thread Uwe Ligges
Mark Marques wrote:

   Cloud() function does not display anything with R1.8.0beta
   in WindowsXP ...
   Does any one noticed this ?
No. Works in the latest beta on my machine.

   others functions from lattice seem working properly.
   does it work in the final 1.8.0 for windows ?
Yes.

Uwe Ligges

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Is there a bug in qr(..,LAPACK=T)

2003-07-17 Thread Adelchi Azzalini
On Wednesday 16 July 2003 20:50, Mike Meyer wrote:
 Several people have kindly (and gently) pointed out that the ?qr
 documentation states that rank detection does not work for the LAPACK case.
  Its my fault for assuming that rank detection did work. --Mike

sprictly speaking is your fault,
however it seems sensible that qr(..) returns the rank value as NULL or NA 
when LAPACK=TRUE -- since it does not try to evaluate it -- instead of
always returning `full rank'.

regards, Adelchi
-- 
Adelchi Azzalini  [EMAIL PROTECTED]
Dipart.Scienze Statistiche, Università di Padova, Italia
http://azzalini.stat.unipd.it/

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Is there a bug in qr(..,LAPACK=T)

2003-07-16 Thread Ravi Varadhan

As the help page for qr says, LAPACK does not attempt to detect 
linear dependencies or rank deficiencies, so you should not use the 
value of rank obtained with argument, LAPACK = TRUE. Computing the 
rank of a matrix using finite precision is difficult, as the example on 
the help page for qr shows using Hilbert matrix order 9.  The rank 
can change depending on tolerance option, which is actually not used 
if LAPACK = TRUE.

Ravi.

- Original Message -
From: Mike Meyer [EMAIL PROTECTED]
Date: Wednesday, July 16, 2003 12:54 pm
Subject: [R] Is there a bug in qr(..,LAPACK=T)

 The following snippet suggests that there is either a bug in 
 qr(,LAPACK=T), or some bug in my understanding.   Note that the 
 detected rank is correct (= 2) using the default LINPACK qr, but 
 incorrect (=3) using LAPACK.   This is running on Linux Redhat 
 9.0, using the lapack library that comes with the Redhat 
 distribution.   I'm running R 1.7.1 compiled from the source.  If 
 the bug is in my understanding (or in the Redhat 9.0 libraries or 
 compiler) I would much appreciate some enlightenment.
 Thanks, --Mike
 
  X
 [,1] [,2] [,3]
 [1,]111
 [2,]121
 [3,]131
 [4,]141
  qr(X)
 $qr
 [,1]   [,2] [,3]
 [1,] -2.0 -5.000   -2
 [2,]  0.5 -2.23606800
 [3,]  0.5  0.44721360
 [4,]  0.5  0.89442720
 
 $rank
 [1] 2
 
 $qraux
 [1] 1.5 1.0 0.0
 
 $pivot
 [1] 1 2 3
 
 attr(,class)
 [1] qr
 
  qr(X,LAPACK=T)
 $qr
   [,1]   [,2]  [,3]
 [1,] -5.4772256 -1.8257419 -1.825742e+00
 [2,]  0.3087742 -0.8164966 -8.164966e-01
 [3,]  0.4631613 -0.3270981 -1.378276e-16
 [4,]  0.6175484 -0.7892454  9.055216e-01
 
 $rank
 [1] 3
 
 $qraux
 [1] 1.182574 1.156135 1.098920
 
 $pivot
 [1] 2 1 3
 
 attr(,useLAPACK)
 [1] TRUE
 attr(,class)
 [1] qr
 
 
 -- 
 
 Mike Meyer,  Seattle WA
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Is there a bug in qr(..,LAPACK=T)

2003-07-16 Thread Mike Meyer
Several people have kindly (and gently) pointed out that the ?qr documentation states 
that rank detection does not work for the LAPACK case.  Its my fault for assuming that 
rank detection did work. --Mike


On Wed, 16 Jul 2003 09:54:39 -0700
Mike Meyer [EMAIL PROTECTED] wrote:

 The following snippet suggests that there is either a bug in qr(,LAPACK=T), or some 
 bug in my understanding.   Note that the detected rank is correct (= 2) using the 
 default LINPACK qr, but incorrect (=3) using LAPACK.   This is running on Linux 
 Redhat 9.0, using the lapack library that comes with the Redhat distribution.   I'm 
 running R 1.7.1 compiled from the source.  If the bug is in my understanding (or in 
 the Redhat 9.0 libraries or compiler) I would much appreciate some enlightenment.
 Thanks, --Mike
 
  X
  [,1] [,2] [,3]
 [1,]111
 [2,]121
 [3,]131
 [4,]141
  qr(X)
 $qr
  [,1]   [,2] [,3]
 [1,] -2.0 -5.000   -2
 [2,]  0.5 -2.23606800
 [3,]  0.5  0.44721360
 [4,]  0.5  0.89442720
 
 $rank
 [1] 2
 
 $qraux
 [1] 1.5 1.0 0.0
 
 $pivot
 [1] 1 2 3
 
 attr(,class)
 [1] qr
 
  qr(X,LAPACK=T)
 $qr
[,1]   [,2]  [,3]
 [1,] -5.4772256 -1.8257419 -1.825742e+00
 [2,]  0.3087742 -0.8164966 -8.164966e-01
 [3,]  0.4631613 -0.3270981 -1.378276e-16
 [4,]  0.6175484 -0.7892454  9.055216e-01
 
 $rank
 [1] 3
 
 $qraux
 [1] 1.182574 1.156135 1.098920
 
 $pivot
 [1] 2 1 3
 
 attr(,useLAPACK)
 [1] TRUE
 attr(,class)
 [1] qr
 
 
 -- 
 
 Mike Meyer,  Seattle WA
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 


-- 

Mike Meyer,  Seattle WA

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Is it a bug in list() behavior?

2003-03-24 Thread Uwe Ligges
wolski wrote:
Hello!

let:

test-1:3
list(test)
names(test)-c(X11,X12,Y23)
test[[Y2]]
3

I had assumed that the names in a list are like a keys in a hash.
Therefore i thought that no value should be returned.
The behavior of:


test[Y2]
NA 
  NA 

is as i expected.

Should it be as it is? How is the definition of [[]] and []?
No! See An Introduction to R, Section 6.1:
The names of components may be abbreviated down to the minimum number 
of letters needed to identify them uniquely. Thus Lst$coefficients may 
be minimally specified as Lst$coe and Lst$covariance as Lst$cov.

Uwe Ligges

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Is it a bug in list() behavior?

2003-03-24 Thread Tony Plate
As wolski/Eryk's example shows, it seems that [[ for lists accepts abbreviations, 
whereas [ does not.  Is this intended?  (This is a difference from S-plus - both [ 
and [[ for lists accept abbreviations in S-plus (V6.1 for Windows at least.)

I couldn't find any mention of this difference in regards to accepting abbreviations 
in either ?[ or section 6.1 of the Introduction to R, or in the R Language Manual, 
or in the R Reference Manual.  [As an aside, I'd rather that the subset operators 
didn't accept abbreviations at all,but ...]

The name returned by [ for a non-existent element of a list also seems of dubious 
correctness.

 list(abc=123)[[a]]
[1] 123
 list(abc=123)[a]
$NA
NULL

 list(abc=123)$a
[1] 123
 version
 _  
platform i386-pc-mingw32
arch i386   
os   mingw32
system   i386, mingw32  
status  
major1  
minor6.2
year 2003   
month01 
day  10 
language R  



At Monday 04:54 PM 3/24/2003 +0100, you wrote:
wolski wrote:
Hello!
let:
test-1:3
list(test)
names(test)-c(X11,X12,Y23)

test[[Y2]]
3
I had assumed that the names in a list are like a keys in a hash.
Therefore i thought that no value should be returned.
The behavior of:

test[Y2]
NA   NA 
is as i expected.

Should it be as it is? How is the definition of [[]] and []?

No! See An Introduction to R, Section 6.1:
The names of components may be abbreviated down to the minimum number of letters 
needed to identify them uniquely. Thus Lst$coefficients may be minimally specified as 
Lst$coe and Lst$covariance as Lst$cov.

Uwe Ligges

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Is it a bug in list() behavior?

2003-03-24 Thread Uwe Ligges
Tony Plate wrote:
As wolski/Eryk's example shows, it seems that [[ for lists accepts abbreviations, whereas [ does not.  Is this intended?  (This is a difference from S-plus - both [ and [[ for lists accept abbreviations in S-plus (V6.1 for Windows at least.)
The general subscripting operator [] doesn't support abbreviations at 
all. I don't know of any reference that states [] supports partial 
matching of character strings.


I couldn't find any mention of this difference in regards to accepting abbreviations in either ?[ or section 6.1 of the Introduction to R, or in the R Language Manual, or in the R Reference Manual.  [As an aside, I'd rather that the subset operators didn't accept abbreviations at all,but ...]
[[]] is the component extractor for lists, and the reference I gave 
tells us that partial matching works for component indexing.
I agree that it's a good idea to mention this behaviour in the R 
Language *Definition* manual.



The name returned by [ for a non-existent element of a list also seems of dubious correctness.


list(abc=123)[[a]]
[1] 123

list(abc=123)[a]
$NA
NULL
Everything as expected from my point of view. Do you mean the NA is 
dubious?

See the R Language Definition, Section 3.4.1:
Notice however, that there are different modes of NAthe literal 
constant is of mode logical, but it is frequently automatically 
coerced to other types.
Remember, it's a name!

Uwe Ligges



list(abc=123)$a
[1] 123

version
 _  
platform i386-pc-mingw32
arch i386   
os   mingw32
system   i386, mingw32  
status  
major1  
minor6.2
year 2003   
month01 
day  10 
language R  



At Monday 04:54 PM 3/24/2003 +0100, you wrote:

wolski wrote:

Hello!
let:
test-1:3
list(test)
names(test)-c(X11,X12,Y23)

test[[Y2]]
3
I had assumed that the names in a list are like a keys in a hash.
Therefore i thought that no value should be returned.
The behavior of:

test[Y2]
NA   NA 
is as i expected.

Should it be as it is? How is the definition of [[]] and []?
No! See An Introduction to R, Section 6.1:
The names of components may be abbreviated down to the minimum number of letters needed to 
identify them uniquely. Thus Lst$coefficients may be minimally specified as Lst$coe and 
Lst$covariance as Lst$cov.
Uwe Ligges

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Is it a bug in list() behavior?

2003-03-24 Thread Spencer Graves
This is a difference between S-Plus and R.

S-Plus 6.1 for Windows Professional Ed. Rel. 1:
 tst - c(a1 = 1, b2 = 3)
 tst[a]
 a1
  1
R 1.6.2:
 tst - c(a1=1, b2=3)
 tst[a]
NA
  NA
This is important for me, because some of my collaborators use S-Plus 
but not R and others use R but not S-Plus.  It's best for me if I can 
adopt a style of use that is maximally transportable.

Best Wishes,
Spencer Graves
Uwe Ligges wrote:
Tony Plate wrote:

As wolski/Eryk's example shows, it seems that [[ for lists accepts 
abbreviations, whereas [ does not.  Is this intended?  (This is a 
difference from S-plus - both [ and [[ for lists accept 
abbreviations in S-plus (V6.1 for Windows at least.)


The general subscripting operator [] doesn't support abbreviations at 
all. I don't know of any reference that states [] supports partial 
matching of character strings.


I couldn't find any mention of this difference in regards to accepting 
abbreviations in either ?[ or section 6.1 of the Introduction to R, 
or in the R Language Manual, or in the R Reference Manual.  [As an 
aside, I'd rather that the subset operators didn't accept 
abbreviations at all,but ...]


[[]] is the component extractor for lists, and the reference I gave 
tells us that partial matching works for component indexing.
I agree that it's a good idea to mention this behaviour in the R 
Language *Definition* manual.



The name returned by [ for a non-existent element of a list also 
seems of dubious correctness.


list(abc=123)[[a]]


[1] 123

list(abc=123)[a]


$NA
NULL


Everything as expected from my point of view. Do you mean the NA is 
dubious?

See the R Language Definition, Section 3.4.1:
Notice however, that there are different modes of NAthe literal 
constant is of mode logical, but it is frequently automatically 
coerced to other types.
Remember, it's a name!

Uwe Ligges



list(abc=123)$a


[1] 123

version


 _  platform i386-pc-mingw32
arch i386   os   mingw32system   i386, 
mingw32  status  major1  minor
6.2year 2003   month01 
day  10 language R 

At Monday 04:54 PM 3/24/2003 +0100, you wrote:

wolski wrote:

Hello!
let:
test-1:3
list(test)
names(test)-c(X11,X12,Y23)

test[[Y2]]


3
I had assumed that the names in a list are like a keys in a hash.
Therefore i thought that no value should be returned.
The behavior of:

test[Y2]


NA   NA is as i expected.

Should it be as it is? How is the definition of [[]] and []?


No! See An Introduction to R, Section 6.1:
The names of components may be abbreviated down to the minimum 
number of letters needed to identify them uniquely. Thus 
Lst$coefficients may be minimally specified as Lst$coe and 
Lst$covariance as Lst$cov.

Uwe Ligges

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Is it a bug in list() behavior?

2003-03-24 Thread Tony Plate
At Monday 07:31 PM 3/24/2003 +0100, Uwe Ligges wrote:
Tony Plate wrote:
As wolski/Eryk's example shows, it seems that [[ for lists accepts abbreviations, 
whereas [ does not.  Is this intended?  (This is a difference from S-plus - both 
[ and [[ for lists accept abbreviations in S-plus (V6.1 for Windows at least.)

The general subscripting operator [] doesn't support abbreviations at all. I don't 
know of any reference that states [] supports partial matching of character strings.

My copy of the Blue Book, Section 11.4.1 (p357 of 1996 printing) seems to pretty 
strongly imply that [ supports partial matching of character strings (it gives 
S-code for handling of indices, and uses pmatch for handling character indices in 
extraction contexts).  However, I certainly wouldn't advocate adding this to R if all 
existing software works without this capability.  It does seem worth documenting in 
place where beginning users can find it though.

The name returned by [ for a non-existent element of a list also seems of dubious 
correctness.

list(abc=123)[[a]]
[1] 123

list(abc=123)[a]
$NA
NULL

Everything as expected from my point of view. Do you mean the NA is dubious?

Yes, the string NA as a name is of dubious correctness.  The behavior of [ with 
vectors is more what I would have expected:
 c(abc=123)[ab]
NA 
  NA 


-- Tony Plate

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Is it a bug in list() behavior?

2003-03-24 Thread Uwe Ligges
Tony Plate wrote:
 
 At Monday 07:31 PM 3/24/2003 +0100, Uwe Ligges wrote:
 Tony Plate wrote:
 As wolski/Eryk's example shows, it seems that [[ for lists accepts 
 abbreviations, whereas [ does not.  Is this intended?  (This is a difference 
 from S-plus - both [ and [[ for lists accept abbreviations in S-plus (V6.1 for 
 Windows at least.)
 
 The general subscripting operator [] doesn't support abbreviations at all. I don't 
 know of any reference that states [] supports partial matching of character strings.
 
 My copy of the Blue Book, Section 11.4.1 (p357 of 1996 printing) seems to pretty 
 strongly imply that [ supports partial matching of character strings (it gives 
 S-code for handling of indices, and uses pmatch for handling character indices in 
 extraction contexts).  However, I certainly wouldn't advocate adding this to R if 
 all existing software works without this capability.  It does seem worth documenting 
 in place where beginning users can find it though.
 
 The name returned by [ for a non-existent element of a list also seems of 
 dubious correctness.
 
 list(abc=123)[[a]]
 [1] 123
 
 list(abc=123)[a]
 $NA
 NULL
 
 Everything as expected from my point of view. Do you mean the NA is dubious?
 
 Yes, the string NA as a name is of dubious correctness.  The behavior of [ with 
 vectors is more what I would have expected:
  c(abc=123)[ab]
 NA
   NA
 
 
 -- Tony Plate

Two last points:
- related to Tony Plate's mail: I don't have any S books at home (where
I am right now).
- related to Spencer Graves' mail: Transportability is not really an
issue. Or do you want to write code relying on partial matching? I
won't-or try to avoid it, at least. Example:
 LL - list(a1=1, a2=2)
 LL$a # Hmmm ... partial matching can be quite dangerous!

I leave this topic open now.

Uwe

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help