Skip to content

strings as factors

1 message · Bill Venables

#
Here is a possibility:
id       sex 
"integer"  "factor"
id         sex 
  "integer" "character" 


But I am surprised at the reason you give for needing it as a character
vector, because factors often act as character vectors under matching
anyway.
[1] male   male   female female
Levels: female male
[1] 1 2
[1] 1 2

Bill Venables
 

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Alexander Nervedi
Sent: Tuesday, 12 December 2006 10:09 AM
To: r-help at stat.math.ethz.ch
Subject: [R] strings as factors

Hi,
To be able to match cases with a benchmark I need to have a data.frame
with 
a character id variable. however, I am surprised why this seems to be so

hard. In fact I was  unable to succeed. Here is what I tried:
[1] "factor"   "oldClass"
[1] "factor"   "oldClass"
[1] "factor"   "oldClass"
[1] "factor"   "oldClass"
$stringsAsFactors
[1] FALSE
[1] "factor"   "oldClass"


is there anyway I can get sex to be a character?

Arnab

_________________________________________________________________
Visit MSN Holiday Challenge for your chance to win up to $50,000 in
Holiday

______________________________________________
R-help at stat.math.ethz.ch 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.