Bug 13505 - bug in proj()
bug in proj()
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: Wishlist
old
ix86 (32-bit) Windows 32-bit
: P5 normal
Assigned To: Jitterbug compatibility account
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-05 20:33 UTC by Jitterbug compatibility account
Modified: 2009-02-05 20:33 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jitterbug compatibility account 2009-02-05 20:33:34 UTC
From: "Richard M. Heiberger" <rmh@temple.edu>
The result of proj() is not currently coerced to data.frame
when requested.  I use this capability pedagogically all the time.
It did work when I wrote proj() for the Chambers and Hastie book, and
it still works in S-Plus.  A minimal repair is in the as.data.frame.aovproj 
definition below.

Rich

> version
               _                           
platform       i386-pc-mingw32             
arch           i386                        
os             mingw32                     
system         i386, mingw32               
status                                     
major          2                           
minor          8.1                         
year           2008                        
month          12                          
day            22                          
svn rev        47281                       
language       R                           
version.string R version 2.8.1 (2008-12-22)
>

## using the example in ?aov

utils::data(npk, package="MASS")

npk.aov <- aov(yield ~ block + N * P + K, npk)
proj(npk.aov)
cbind(npk, proj(npk.aov))

as.data.frame.aovproj <- function(x, ...) as.data.frame(unclass(x), ...)

cbind(npk, proj(npk.aov))



> cbind(npk, proj(npk.aov))
Error in as.data.frame.default(x[[i]], optional = TRUE) : 
  cannot coerce class "aovproj" into a data.frame
> as.data.frame.aovproj <- function(x, ...) as.data.frame(unclass(x), ...)
> cbind(npk, proj(npk.aov))
   block N P K yield (Intercept)  block         N          P         K
1      1 0 1 1  49.5      54.875 -0.850 -2.808333 -0.5916667 -1.991667
....

Comment 1 Jitterbug compatibility account 2009-05-27 19:58:00 UTC
NOTES:
 Not a bug in proj, which does not claim to return data frames.

Method added in 2.10.0
Comment 2 Jitterbug compatibility account 2009-05-27 19:58:48 UTC
Audit (from Jitterbug):
Fri Feb 13 09:36:39 2009	ripley	moved from incoming to Analyses
Wed May 27 14:58:47 2009	ripley	changed notes
Wed May 27 14:58:48 2009	ripley	moved from Analyses to wishlst-fulfilled