On Aug 8, 2015, at 1:44 PM, Nikita Dinger wrote:

> y <- matrix(rep(10,4),2,2)
>> y
>     [,1] [,2]
> [1,]   10   10
> [2,]   10   10
> 
> 
> 
> I expected an output of
>> y
>     [,1] [,2]
> [1,]   10   4
> [2,]   10   4
> 

When you get something you don't expect, you should start by examining the 
arguments. Type this at your console:

rep(10,4)

It should then be obvious that you need to read the help page for `rep`.

-- 
David.
> 
> 
> Thanks and Regards.
> 
>       [[alternative HTML version deleted]]

And do read the Posting guide.

> 
> ______________________________________________
> R-help@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.

David Winsemius
Alameda, CA, USA

______________________________________________
R-help@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.

Reply via email to