[R] R 1.2.1 - read.table factors

gordon.harrington@uni.edu gordon.harrington at uni.edu
Tue Jan 30 11:05:53 CET 2001


R-1.2.1 Suse 7.0 binary

> fooframe <- read.table("foo", header=FALSE, as.is=c(1:22,398),
col.names=foo.colheads)

cols 1-9 are alphabetic, 10-22 and 398 are numbers but unordered categorical
	23-375 are numeric with and without decimal points

As I read the description the "as.is" index numbers should force those columns
to be "character" and "factor". However only the 1-9 alpha become "character"
but they did not become "factor". Everything else shows mode "numeric" but
"is.factor" distributes TRUE to various variables in no pattern discernible to
me either in distribution or in the data content of the columns. (I tried
giving as.is a type vector but that just made everything "numeric" with no
pattern to factors.) No "as.is" parameter still leaves the odd distribution of
factors.

The main effects are that for some statistical functions on data subsets, one
is warned one cannot perform the operations on categorical data while others
stop for NA's. There are no NA's in the dataset! Running "unique" on each
variate and collecting outside the frame shows adequate dispersion for analysis
with no zero variances. "cor" will only run "pairwise" though "complete.cases"
finds no NA's.

What am I missing?





Gordon M. Harrington		Mail:	3720 Village Place, #6308
Professor Emeritus			Waterloo, IA 50702-5848
University of Northern Iowa 	Phone:	319-291-8535
gordon.harrington at uni.edu	Fax:	319-291-8491
dryfly at aya.yale.edu			319-291-8324

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list