[R] coercion

Petr Savicky savicky at praha1.ff.cuni.cz
Wed Apr 20 12:07:10 CEST 2011


On Wed, Apr 20, 2011 at 11:26:19AM +0430, Stat Consult wrote:
> Dear ALL
> 
> I don't know why I can see this error in run this sentences.
> 
> In paste("V", 1L:cols, sep = "") : NAs introduced by coercion

Check, what "cols" is. This warning may be obtained, if "cols"
is a character value. For example

  cols <- "a"
  paste("V", 1L:cols, sep = "")

  Error in 1L:cols : NA/NaN argument
  In addition: Warning message:
  In paste("V", 1L:cols, sep = "") : NAs introduced by coercion

> DATA<-read.delim ("D:\\DATA\\GeneExpression.txt",header=FALSE)

What is the relationship of this to the command above?

If you include a reproducible example, you have a better chance
to get a useful answer.

Petr Savicky.



More information about the R-help mailing list