[R] arguments imply differing number of rows

ruipbarradas at sapo.pt ruipbarradas at sapo.pt
Wed Sep 20 17:17:36 CEST 2017


Hello,

Just count:
   city is 3*5 == 15,
   population is length(4000:6000) + length(3500:4300) + length(3000:3200)
                 == 2001 + 801 + 201 == 3003
Hope this helps,

Rui Barradas



Citando Shivi Bhatia <shivipmp82 at gmail.com>:

> Hi Team,
>
> I using the syntax as:
>
> data.df<- data.frame(
>   city= c(rep(c("Delhi", "Bangalore","Chandigarh"),each=5)),
>   population= c(4000:6000,3500:4300,3000:3200)
> )
>
> But i am getting the error as arguments imply differing number of rows: 15,
> 3003.
>
> Tried searching google but could not understand & find the solution.
>
> Thanks, Shivi
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list