[R] issue with numeric

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Wed Dec 18 20:45:53 CET 2019


On Wed, 18 Dec 2019 12:25:24 -0600
Ana Marija <sokovic.anamarija using gmail.com> wrote:

> Error in cor(D[, 18 + exon_offset], D[, 19 + exon_offset]) :
>   'x' must be numeric

Try str(a) to find out the types of the columns. A stray typo could
make a representation of a number impossible to parse and make the
whole column textual. Use
which(is.na(as.numeric(as.character(a[,column_number])))) to find out
the row number where it happened (using extra as.character() here in
case the column is a factor).

-- 
Best regards,
Ivan



More information about the R-help mailing list