Re: [R] coercion

From: Petr Savicky <>
Date: Wed, 20 Apr 2011 12:07:10 +0200

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. mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Wed 20 Apr 2011 - 10:28:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 20 Apr 2011 - 10:40:31 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive