[R] removing contractions for recode in car

Nicole Marie Ford nmford at uwm.edu
Thu Dec 15 21:49:04 CET 2011


hello,

i need to recode a variable, however the contraction is causing problems.  i had the code to change this written down somewhere and i just can't find it, of course.

i am using the car library to recode.

it's only 5 levels when it should have 6... when i do levels(trust).

here is my recode: 


trust <- recode(Poland$SN35B, " 'Strongly Agree' = 1; 'Agree' = 2; 'Neither Agree nor Disagree' = 3; 'Disagree' = 4; 'Strongly Disagree' = 5; 'Can't choose' = 6; else=NA")


thanks.

~nicole
----- Original Message -----
From: "David Winsemius" <dwinsemius at comcast.net>
To: "Rui Barradas" <ruipbarradas at sapo.pt>
Cc: r-help at r-project.org
Sent: Thursday, December 15, 2011 2:33:32 PM
Subject: Re: [R] printing all htest class members


On Dec 15, 2011, at 2:16 PM, Rui Barradas wrote:

> You're right, David,
>
> The first line is wrong, it should be
>
> ...  df=2:4  ...
>
> As for creating something, try
>
>> ht <- structure( ... etc ...
>> ht
>> class(ht)
>
> See what is printed and what function prints it.

Well, the function is stats:::print.htest.

(Do not expect any further replies to emails sent without context.)

#---------------------------------------------------#
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
#---------------------------------------------------#
>

David Winsemius, MD
West Hartford, CT

______________________________________________
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.



More information about the R-help mailing list