Re: [R] Factor vs character in a data.frame vs vector

2017-07-08 Thread John Kane via R-help
Clearly I have been doing something weird. Thanks >It is possible that somewhere along the way, you set options(stringsAsFactors = FALSE)No not in a long time. I found that it was great for any personal work but any time I tried to use someone' else's raw data, say from a text file, it would

Re: [R] Factor vs character in a data.frame vs vector

2017-07-07 Thread John Kane via R-help
Thanks Marc. It never occurred to me that I would need a ""stringsAsFactors" expression in a data.frame.  I could have sworn I never did before when mocking up some data but clearly I was wrong or there has been a change in R v. 3.4.1 which seems unlikely. On Friday, July 7, 2017, 10:37:29 AM

Re: [R] Factor vs character in a data.frame vs vector

2017-07-07 Thread Marc Schwartz
> On Jul 7, 2017, at 7:03 PM, John Kane wrote: > > Thanks Marc. > It never occurred to me that I would need a ""stringsAsFactors" expression in > a data.frame. I could have sworn I never did before when mocking up some > data but clearly I was wrong or there has been a

Re: [R] Factor vs character in a data.frame vs vector

2017-07-07 Thread Marc Schwartz
> On Jul 7, 2017, at 6:03 AM, John Kane via R-help wrote: > > This is not serious problem but I just wonder if someone can explain what is > happening. > The same command within a dataframe is giving me a factor and as a plain > vector is giving me a character. It's

[R] Factor vs character in a data.frame vs vector

2017-07-07 Thread John Kane via R-help
This is not  serious problem but I just wonder if someone can explain what is happening. The same command within a dataframe is giving me a factor and as a plain vector is giving me a character.  It's probably something simple that I have read and forgotten but I thought I'd ask. Thanks