[Rd] Merge (PR#9699)

2007-05-28 Thread edward . m
Full_Name: Edward McNeil
Version: 2.5.0
OS: Windows XP
Submission from: (NULL) (203.170.234.5)


This is a new bug introduced to R2.5.0. 

Scenario: If one of the data frames to merge contains two variables that have
the same name, then the data in first variable (of the same name) is copied to
the second variable in the resulting merged data frame. 

In R2.4.1, the second variable name is automatically renamed (in the resulting
data frame) by adding ".1" to the end. R2.5.0 doesn't seem to do this anymore.

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


Re: [Rd] Merge (PR#9699)

2007-05-28 Thread edward . m
Yes, it appears to have been resolved in R2.5.0pat, although the 
counter-example provided *does* fail in R2.5.0.

A <- data.frame(x=1:3, y=4:6, y=7:9, check.names=FALSE)
B <- data.frame(x=1:3, a=3:1)
A
  x y y
1 1 4 7
2 2 5 8
3 3 6 9
B
  x a
1 1 3
2 2 2
3 3 1
merge(A, B)
  x y y.1 a
1 1 4   4 3
2 2 5   5 2
3 3 6   6 1
---

Prof Brian Ripley wrote:
> On Mon, 21 May 2007, [EMAIL PROTECTED] wrote:
>
>> Full_Name: Edward McNeil
>> Version: 2.5.0
>> OS: Windows XP
>> Submission from: (NULL) (203.170.234.5)
>>
>>
>> This is a new bug introduced to R2.5.0.
>>
>> Scenario: If one of the data frames to merge contains two variables 
>> that have
>> the same name, then the data in first variable (of the same name) is 
>> copied to
>> the second variable in the resulting merged data frame.
>
> This is probably
>
> o[i, j] could sometimes select the wrong column
> when j is numeric if there are duplicate column names.
>
> from NEWS and hence already fixed in R-patched.
>
>> In R2.4.1, the second variable name is automatically renamed (in the 
>> resulting
>> data frame) by adding ".1" to the end. R2.5.0 doesn't seem to do this 
>> anymore.
>
> This is not reproducible:
>
> A <- data.frame(x=1:3, y=4:6, y=7:9, check.names=FALSE)
> B <- data.frame(x=1:3, a=3:1)
> merge(A, B)
>
> works correctly in R-patched.  You were asked for a reproducible 
> example: if you have one in current R-patched, please supply it now 
> (using PR#9699 early in your subject line).
>
>

-- 
This message has been scanned for viruses and\ dangerous con...{{dropped}}

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


[Rd] Adding a survival object to a data frame (PR#10510)

2007-12-12 Thread edward . m
Full_Name: Edward McNeil
Version: 2.6.1
OS: Windows
Submission from: (NULL) (203.170.234.5)


I want to show students how the survival object looks like in R.
Reproducible example:

library(MASS)
data(Aids2)
attach(Aids2)
status <- status=="D"
stime <- death-diag
surv <- Surv(stime, status)
D <- data.frame(stime, status, surv)
head(D,20)
   stime status x..i..
1176   TRUE   176 
2 67   TRUE67 
3432   TRUE   432 
4 77   TRUE77 
5275   TRUE   275 
6373   TRUE   373 
7389   TRUE   389 
8   1027   TRUE  1027 
9492   TRUE   492 
10   434   TRUE   434 
1116   TRUE16 
12   308   TRUE   308 
1392   TRUE92 
14   265   TRUE   265 
15  1052  FALSE  1052+
16   132   TRUE   132 
17   527   TRUE   527 
18   581  FALSE   581+
19   511  FALSE   511+
20   151   TRUE   151 

detach(Aids2)

The 'surv' column is strangely labelled 'x..i..'.

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


[Rd] Sys.setlocale upsets windows graphics device (PR#8887)

2006-05-22 Thread edward . m
Full_Name: Edward McNeil
Version: 2.3.0
OS: Widows XP
Submission from: (NULL) (203.170.234.5)


Type the following:

> Sys.setlocale("LC_ALL","C")
> hist(1:10)

CRASH

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


Re: [Rd] Sys.setlocale upsets windows graphics device (PR#8887)

2006-05-22 Thread edward . m
Hi,
We tried it on 3 separate windows XP computers using version 2.3.0.
The original locale is set for Thailand on all 3.
So how do we fix it? Is there another patch?
And why does the crash not happen with earlier R versions (eg. 2.2.1) on the 
same computer?

---
> Sys.getlocale()
[1] 
"LC_COLLATE=Thai_Thailand.874;LC_CTYPE=Thai_Thailand.874;LC_MONETARY=Thai_Thailand.874;LC_NUMERIC=C;LC_TIME=Thai_Thailand.874"
---

Thanks
Edward

- Original Message - 
From: "Prof Brian Ripley" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, May 22, 2006 2:32 PM
Subject: Re: [Rd] Sys.setlocale upsets windows graphics device (PR#8887)


> Works perfectly for me.  There was a bug in 2.2.1, but it was fixed in
> 2.2.1 patched (see CHANGES).
>
> What locale were you changing from?  (This might be a Windows problem 
> specific to your locale.)
>
> On Mon, 22 May 2006, [EMAIL PROTECTED] wrote:
>
>> Full_Name: Edward McNeil
>> Version: 2.3.0
>> OS: Widows XP
>> Submission from: (NULL) (203.170.234.5)
>>
>>
>> Type the following:
>>
>>> Sys.setlocale("LC_ALL","C")
>>> hist(1:10)
>>
>> CRASH
>>
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>>
>
> -- 
> Brian D. Ripley,  [EMAIL PROTECTED]
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford, Tel:  +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UKFax:  +44 1865 272595

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