Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • d2611de
  • /
  • Mammals.R
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge
swh:1:cnt:5dca815e9bf6c4853d94f2ba054cacb6cdc6c940
directory badge
swh:1:dir:d2611de1369f7943b92aa204b74399bee36223bd

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Mammals.R
require(quantreg)
data(Mammals)
     attach(Mammals)
     x <- log(weight)
     xx <- unique(x[order(x)])
     y <- log(speed)
     plot(x,y, xlab="Weight in log(Kg)", ylab="Speed in log(Km/hour)",type="n")
     points(x[hoppers],y[hoppers],pch = "h", col="red")
     points(x[specials],y[specials],pch = "s", col="blue")
     others <- (!hoppers & !specials)
     points(x[others],y[others], col="black",cex = .75)
     taus <- c(.5, .9)
     for(i in 1:length(taus)){
        fit <- rqss(y ~ qss(x, lambda = 1, constraint = "C"),tau = taus[i])
        plot(fit,title = "Running Speed of Mammals", add = TRUE, col = i, lwd = 1.5)
        }
     legend(4,2,c("Median", "0.9 Quantile"), lty = 1, col = 1:2, lwd = 1.5)
     #Now plot confidence bands for the tau = .9 fit
     plot(fit,title = "Running Speed of Mammals", band = "both", col = i, lwd = 1.5)
     #Now plot slope of the tau = .9 line
     xy <- fit$qss[[1]]$xyz
     xx <- xy[,1]
     yhat <- fit$coef[1] + xy[,2]
     g <- diff(yhat)/diff(xx)
     plot(xx[-1], g, main = "Fitted Slopes of Running Speed",
          xlab="Weight in log(Kg)", ylab="dlog(Speed) /dlog(Weight)")

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API