Skip to content
Prev 301354 / 398506 Next

How can I correctly access a string element of a dataframe?

1. m2q already is a data frame, so the m2qldf statement that follows
is completely unnecessary.

2. Please read ?read.table carefully, and especially the bit about the
stringsAsFactors argument. The problem is that by default character
strings are read in as factors, not characters strings. So you can
either change the way they are read in thru stringsAsFactors=FALSE or
otherwise as explained therein -- or convert them with as.character()
when you access them, e.g.
On Thu, Jul 26, 2012 at 7:53 AM, jpm miao <miaojpm at gmail.com> wrote: