Quantcast
Channel: What does the error "arguments imply differing number of rows: x, y" mean? - Stack Overflow
Viewing all articles
Browse latest Browse all 4

What does the error "arguments imply differing number of rows: x, y" mean?

$
0
0

I'm trying to create a plot from elements of csv file which looks like this:

h1,h2,h3,h4a,1,0,1,0b,1,1,0,1c,0,0,1,0

I tried the following code but am receiving an error saying

Error in data.frame(id = varieties, attr(mat, "row.names"), check.rows = FALSE) :arguments imply differing number of rows: 8, 20

My sample data has 8 columns and 20 rows (excluding header and row names). I tried to look up online and tried to implement a few fixes but the issue still persists. I'd really appreciate any help.

mat <- read.csv("trial.csv", header=T, row.names=1)varieties = names(mat)df <- data.frame(id=varieties,attr(mat, "row.names"), check.rows= FALSE)

Viewing all articles
Browse latest Browse all 4

Trending Articles