Data frame error: arguments imply differing number of rows

hi,

not able to understand this below error type ,i am new to R-programming.

"Error in data.frame(x, y, z) : 
  arguments imply differing number of rows: 2, 3, 211 "

program-

x=1:20
y=sample(c('cat','dog','cow'),20,replace = T)

z= seq(10,22)

d=data.frame(x,y,z)

#Thank you

I get the following running your code.

x=1:20
y=sample(c('cat','dog','cow'),20,replace = T)

z= seq(10,22)

d=data.frame(x,y,z)
#> Error in data.frame(x, y, z): arguments imply differing number of rows: 20, 13

length(z)
#> [1] 13

Created on 2019-09-22 by the reprex package (v0.2.1)
The vectors x and y have length 20 and z has length 13.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.