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

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
content badge
swh:1:cnt:297b01f6ae349087bb28dcd5aab8cc5f4f6daf03

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
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
using DataFrames, CSV, Statistics, Dates

cd(joinpath(ENV["HOME"], "Dropbox", "McKay_CodeChecking", "Code", "Fig4"))

function convertdays2weeks(x)
    return Int.(round.(x/7, RoundUp))
end

function convertdays23weeks(x)
    return Int.(round.(x/21, RoundUp))
end

df = CSV.read("../../Data/Table S4.csv")

# make sure all missing observed are unobserved
df[ismissing.(df[:Observed]), :Observed] = 0

# for all without death dates, make today and unobserved
x = (Dates.today())
x = map(p -> p.value, [Month(x) Day(x) Year(x)-Year(2000)])
y = join(x, "/")
df[ismissing.(df[:DeathDate]), :DeathDate] .= y
df[:DeathDate] = map(p -> Dates.Date(p, "m/dd/yy") + Year(2000), df[:DeathDate])

# and calculate lifespan
# put in temp hatch date for some:
df[:HatchDate] = map(p -> Dates.Date(p, "m/dd/yy") + Year(2000), df[:HatchDate])

df[:Lifespan_days] = df[:DeathDate] .- df[:HatchDate]
df[:Lifespan_days] = map(p -> p.value, df[:Lifespan_days])

#remove Array{Missing,1} from df
df = df[:,map(p -> typeof(df[p]) != Array{Missing,1}, names(df))]

df[:Lifespan_weeks] = convertdays2weeks(df[:Lifespan_days])
df[:Lifespan_3weeks] = convertdays23weeks(df[:Lifespan_days])

# export for lifespan alone
CSV.write("lifespandata.csv", df)

back to top

Software Heritage — Copyright (C) 2015–2025, 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