View the codes in fullscreen by clicking the fullscreen button on top right corner of the code block (Hover the mouse pointer upon the code block, you will see the fullscreen button.)
Very Long R code
# source code of stats::lmfunction (formula, data, subset, weights, na.action, method ="qr", model =TRUE, x =FALSE, y =FALSE, qr =TRUE, singular.ok =TRUE, contrasts =NULL, offset, ...) { ret.x <- x ret.y <- y cl <-match.call() mf <-match.call(expand.dots =FALSE) m <-match(c("formula", "data", "subset", "weights", "na.action", "offset"), names(mf), 0L) mf <- mf[c(1L, m)] mf$drop.unused.levels <-TRUE mf[[1L]] <-quote(stats::model.frame) mf <-eval(mf, parent.frame())if (method =="model.frame") return(mf)elseif (method !="qr") warning(gettextf("method = '%s' is not supported. Using 'qr'", method), domain =NA) mt <-attr(mf, "terms") y <-model.response(mf, "numeric") w <-as.vector(model.weights(mf))if (!is.null(w) &&!is.numeric(w)) stop("'weights' must be a numeric vector") offset <-model.offset(mf) mlm <-is.matrix(y) ny <-if (mlm) nrow(y)elselength(y)if (!is.null(offset)) {if (!mlm) offset <-as.vector(offset)if (NROW(offset) != ny) stop(gettextf("number of offsets is %d, should equal %d (number of observations)", NROW(offset), ny), domain =NA) }if (is.empty.model(mt)) { x <-NULL z <-list(coefficients =if (mlm) matrix(NA_real_, 0, ncol(y)) elsenumeric(), residuals = y, fitted.values =0* y, weights = w, rank = 0L, df.residual =if (!is.null(w)) sum(w !=0) else ny)if (!is.null(offset)) { z$fitted.values <- offset z$residuals <- y - offset } }else { x <-model.matrix(mt, mf, contrasts) z <-if (is.null(w)) lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...)elselm.wfit(x, y, w, offset = offset, singular.ok = singular.ok, ...) }class(z) <-c(if (mlm) "mlm", "lm") z$na.action <-attr(mf, "na.action") z$offset <- offset z$contrasts <-attr(x, "contrasts") z$xlevels <-.getXlevels(mt, mf) z$call <- cl z$terms <- mtif (model) z$model <- mfif (ret.x) z$x <- xif (ret.y) z$y <- yif (!qr) z$qr <-NULL z}
Lua code
-- code snippet taken from -- https://pandoc.org/lua-filters.html#counting-words-in-a-document-- for demo.-- counts words in a documentwords=0wordcount={Str=function(el)-- we don't count a word if it's entirely punctuation:ifel.text:match("%P")thenwords=words+1endend,Code=function(el)_,n=el.text:gsub("%S+","")words=words+nend,CodeBlock=function(el)_,n=el.text:gsub("%S+","")words=words+nend}function Pandoc(el)-- skip metadata, just count body:el.blocks:walk(wordcount)print(words.." words in body")os.exit(0)end