[R] Why don't the comments appear in the function?

bickis m@iii@g oii m@th@us@sk@c@ bickis m@iii@g oii m@th@us@sk@c@
Mon Nov 25 00:06:26 CET 2019


I have made a list in which each element is a function.   If I print
individual elements of the list, then the function code is shown along
with embedded comments.  However, if I print the list or sublist, then the
function code is shown without comments.   Why (and how) are the comments
hidden?

>flist[[3]]
function(y,brackets,rates){
	# Calculates before-tax income required to realized value y
	ints<-c(0,cumsum(diff(brackets)*rates[1:(length(rates)-1)]))-brackets*rates
	x<-(y+ints)/(1-rates)
	x[sum(x>brackets)]
}


>flist[3]
$btv
function (y, brackets, rates)
{
    ints <- c(0, cumsum(diff(brackets) * rates[1:(length(rates) -
        1)])) - brackets * rates
    x <- (y + ints)/(1 - rates)
    x[sum(x > brackets)]
}

I am running R 3.3.2 on Mac OS X  10.10.5

Mik Bickis



More information about the R-help mailing list