Re: [Rd] na.action does not return na.action element of lm object
Well, the na.action component (which may or may not be present in an lm object) is *not* what na.action is documented to give: Value: The action which will be applied to 'object' whenever 'NA's are not desired. So this needs some re-working, and it is not just "lm" objects that have the na.action information as a component and not an attribute. On Mon, 25 Aug 2008, Andrew Redd wrote: I'm not sure if this is the official behavior but I would expect the na.action function applied to a lm object to return the na.action. Here is what I mean. x<-0:10 y<-x+rnorm(10) Warning message: In x + rnorm(10) : longer object length is not a multiple of shorter object length y[5]<-NA m<-lm(y~x) m$na.action 5 5 attr(,"class") [1] "omit" na.action(m) NULL I would expect na.action(m) to return m$na.action. This is simple enough to fix with na.action.lm<-function(object,...)object$na.action but I would expect that this would already be included in the base. Is there a reason that it is not? I did a search through the archives but did not turn up anything relevant. Thanks, Andrew Redd __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] bug in package chron (PR#12599)
chron represents times as a fraction of a day using doubles so seconds cannot necessarily be represented exactly thus this is an example of FAQ 7.31: http://cran.r-project.org/doc/manuals/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f Try this: library(chron) tt <- c("09:45:00", "09:45:01", "09:45:04", "09:45:05", "09:45:06", "09:45:08", "09:45:11", "09:45:12", "09:45:14") tt <- times(tt) > trunc(tt[3] + times("00:00:01"), "sec") == tt[4] [1] TRUE See R News 4/1. On Tue, Aug 26, 2008 at 2:05 AM, <[EMAIL PROTECTED]> wrote: > Full_Name: Zeng, zhenxing > Version: 2.7.1 (2008-06-23) > OS: windows XP > Submission from: (NULL) (158.182.1.30) > > > Dear Author > > I have run into a trouble in using chron package > The data frame: a > date time_fut expiry_day bid ask trade_day > 1 2004-09-01 09:45:002004-10 12860 1288938 > 2 2004-09-01 09:45:012004-10 12885 1289038 > 3 2004-09-01 09:45:042004-10 12883 1288738 > 4 2004-09-01 09:45:052004-10 12878 1288638 > 5 2004-09-01 09:45:062004-10 12881 1288738 > 6 2004-09-01 09:45:082004-10 12881 1288238 > 7 2004-09-01 09:45:112004-10 12881 1288438 > 8 2004-09-01 09:45:122004-10 12882 1288438 > 9 2004-09-01 09:45:142004-10 12882 1288338 > > I use the package chron > > a$time_fut<-times(a$time_fut) > a$date<-as.Date(a$date) > a$expiry_day<-as.character(a$expiry_day) > > any(am$time_fut[2]==(am$time_fut[1]+times("00:00:01"))) > the answer: True > any(a$time_fut[5]==(a$time_fut[4]+times("00:00:01"))) > [1] TRUE > any(am$time_fut[4]==(am$time_fut[3]+times("00:00:01"))) > the answer: False > But, the right answer should be true > > I don't know why, I am using the R version: 2.7.1 > attached please find the data. > > Thank you > > Best wishes > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] embedded examples
I am working on embedding R into some visualization research programs. Can any point me to a collection of embedded and standalone R/C/C++ examples? The documentation is to terse for me to figure out how to develop this and I am looking for some simple examples to study. Thanks and best regards, EBo -- __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] [R] embedded examples
You might also want to look at existing visualisation applications that connect with R: * http://ggobi.org * http://rosuda.org/mondrian * http://rosuda.org/software/Gauguin/gauguin.html to name a few. Hadley On Tue, Aug 26, 2008 at 10:31 AM, EBo <[EMAIL PROTECTED]> wrote: > > I am working on embedding R into some visualization research programs. Can > any point me to a collection of embedded and standalone R/C/C++ examples? The > documentation is to terse for me to figure out how to develop this and I am > looking for some simple examples to study. > > Thanks and best regards, > > EBo -- > > __ > [EMAIL PROTECTED] 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. > -- http://had.co.nz/ __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel