更新时间:2023-02-03 08:20:28
我怀疑您对因子有问题.例如,
I suspect you are having a problem with factors. For example,
> x = factor(4:8)
> x
[1] 4 5 6 7 8
Levels: 4 5 6 7 8
> as.numeric(x)
[1] 1 2 3 4 5
> as.numeric(as.character(x))
[1] 4 5 6 7 8
一些评论:
as.numeric
对这些值做什么?read.csv
中,尝试使用参数 stringsAsFactors=FALSE
sep="/t
而不是 sep="\t"
head(pitchman)
检查数据的前几行pichman <- read.csv(file="picman.txt", header=TRUE, sep="/t")
因为我没有访问数据集.as.numeric
to do with these values?read.csv
, try using the argument stringsAsFactors=FALSE
sep="/t
and not sep="\t"
head(pitchman)
to check the first fews rows of your datapichman <- read.csv(file="picman.txt", header=TRUE, sep="/t")
since I don't have access to the data set.