Re: [R] Error in names(x) <- value: 'names' attribute must be the same length as the vector in gam function

2019-01-04 Thread William Dunlap via R-help
mgcv::s() does not appear to work with objects of class "Date". E.g., > d <- data.frame(date=seq(as.Date("2018-12-20"),len=10,by="week"), response=log2(1:10)%%1) > model <- gam(data=d, response ~ s(date)) Error in names(dat) <- object$term : 'names' attribute [1] must be the same length as the

Re: [R] Error in names(x) <- value: 'names' attribute must be the same length as the vector

2012-05-14 Thread David Winsemius
On May 14, 2012, at 2:35 PM, Priya Bhatt wrote: Dear R-helpers, I am stuck on an error in R: When I run my code (below), I get this error back: Error in names(x) <- value : 'names' attribute must be the same length as the vector Then when I use traceback(), R gives me back this in retu

Re: [R] Error in names(x) <- value: 'names' attribute must be the same length as the vector

2012-05-14 Thread Tyler Rinker
I'd throw a browser() in at that point and see what colnames(newdf.int) gives you.  If you have less columns than names this is likely the reason for the error. You can get the same error with: colnames(mtcars) <- LETTERS Cheers,Tyler > Date: Mon, 14 M

Re: [R] error in names

2009-08-11 Thread Gavin Simpson
On Tue, 2009-08-11 at 17:49 +, Inchallah Yarab wrote: > Hi, > what is meaning this errors !!! > Error in names(o.pr)[p.ok] <- names(qs) : > incompatible types (from NULL to character) in subassignment type fix I can replicate this error by 'qs' not having names. what does names(qs) show?