[R] Translation of R code required
Sarah White
swhite at sgul.ac.uk
Fri Nov 3 19:30:28 CET 2006
Thank you for your help. Yes, it was a case-sensitive problem. I have
run all the code now and have the requred output.
Sarah
Sarah Goslee wrote:
> On 11/3/06, Sarah White <swhite at sgul.ac.uk> wrote:
>
>>
>> I am using Windows XP, R version 2.4.
>>
>> The code works until I get to the fourth line starting
>>
>> model.effect
>>
>> and I receive the following Error message.
>>
>> Error in eval(expr, envir, enclos) : object "Centre" not found
>>
>
>
> It sounds like the variable names aren't what you think they are.
> Try this:
>
> mental <- read.csv("dataextract.csv")
> colnames(mental)
>
> If the names don't match exactly, R won't know what you mean.
>
> Since this step works,
>
> mental$Rx <- factor(mental$Rx, levels=c("VS","IPS"))
>
> I think that some of the names are right, but perhaps that
> one is spelled differently (Centre vs centre, maybe, since
> R is case-sensitive?).
>
> The easiest thing to do with no R knowledge is probably
> to change the name in the csv file to match your code,
> if that turns out to be the problem.
>
> Sarah
>
--
---------------------------------------------------------------------
Sarah White
Biostatistician
Research Resource Unit
Division of Mental Health
St George's, University of London
Cranmer Terrace
Tooting
LONDON SW17 0RE
Direct Line; 020 8725 3615
Fax; 020 8725 3538
Email; s.white at sgul.ac.uk
--
believed to be clean.
More information about the R-help
mailing list