[R] Error message: attempt to set rownames on object with no dimensions

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jul 21 16:02:08 CEST 2010


?lme (at least the one in package nlme) seems not to mention that the 
response in 'fixed' must be a numeric variable, but it must (and a 
factor is not numeric).

If you want to use a binary response, you need to use other methods, 
and it would be better to ask on R-sig-mixed-models making clear what 
your aims actually are.

On Wed, 21 Jul 2010, Igor Blanco wrote:

> Hi there,
>
> I am trying to analyze some data using the lme package.

Perhaps you mean the nlme package?

> In my case there is a variable called Newmarker that can only take 2 values
> (number 1 or number 2).
> I have used the as.factor to remark this fact but an error message appears
> stating: attempt to set rownames on object with no dimensions.
>
> Here is the code I have used:
>
> *Dataset <-   read.table("Data2.txt", header=TRUE, sep="", na.strings="NA",
> dec=".", strip.white=TRUE)
>
> Dataset$Newmarker <- as.factor(Dataset$Newmarker)
>
> attach(Dataset)
>
> lme.1 <- lme(Newmarker ~ Age, data=Dataset,  random= ~1|ID)
>
> summary(lme.1)*
>
> If I don't use the as.factor I have no problems but I don't think this is
> the correct way to proceed... The other variables I use can have any value.
>
> Can anybody help me please?
>
> Thanking you in advance,
>
> Regards,
>
> Igor Blanco
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org 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.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
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, UK                Fax:  +44 1865 272595



More information about the R-help mailing list