|>
|> 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
Here is your explanation:
as.is: the default behavior of `read.table' is to convert
non-numeric variables to factors. The variable `as.is'
controls this conversion. Its value is either a vector of
logicals (values are recycled if necessary), or a vector of
numeric indices which specify which columns should be left as
character strings.
Since your column 10, etc are not character, as.is will not have an
effect on them. I think it is simple enough to convert numeric
columns into factors (as distinct from continuous variables) with
factor().
|> "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?
My guess is that something unplanned is happening when you try as.is
on numeric columns.