[R] Basic question about: <<- and method start with dot.

peter dalgaard pdalgd at gmail.com
Tue Oct 2 08:40:59 CEST 2012


On Oct 2, 2012, at 06:00 , Fabrice Tourre wrote:

> Dear list,
> 
> When I read some source code, I find lot of place used  symbol <<- , e.g.
> 
> lastTime <<- newTime;
> 
> What is the meaning here?

Did you check help("<<-") ? The explanation there seems at least as clear as anything I could cook up in a quick mail...

> 
> Also, I find some method with the name start with dot, e.g.
> 
> .RowStandardizeCentered = function(x) {
> 	div = sqrt( rowSums(x^2) );
> 	div[ div == 0 ] = 1;
> 	return( x/div );
> }
> 
> What is the special meaning for the method name start with a dot?

It means nothing in particular, except that such objects don't show up in ls() by default. The _intention_ is usually that the function is only to be used internally and not for end-user use.


-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com




More information about the R-help mailing list