pr is a numeric number indeed slightly less than 66, hence, the vector
generated by

rep(1,pr)

is of length 65 rather than 66...

On Fri, Apr 9, 2010 at 1:58 PM, Covelli Paolo <pcovelli@tele2.it> wrote:

> Hi,
>
> I've got the following code:
>
> p <- 0.34
> pb <- p*100
> pr <- (1-p)*100
>
> A <- rep(0,pb)  # a vector with 34 "zeros"
> B <- rep(1,pr)   # a vector with 66 "ones"
>
> Now if I type
> length(A), R answer correctly 34
>
> but if I type
> length(B), R answer 65 instead of 66.
>
> I don't understand why it happens. Can anyone help me? Thanks in advance.
>
> Paolo
>
> ______________________________________________
> R-help@r-project.org mailing list
> 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.
>

	[[alternative HTML version deleted]]

