Public
Edited
Mar 8, 2023
Insert cell
Insert cell
Insert cell
viewof indivraw = Inputs.file({label: "Data"})
Insert cell
viewof psraw = Inputs.file({ label: "Data" })
Insert cell
indiv = indivraw.csv()
Insert cell
ps2 = psraw.csv()
Insert cell
ps2map["2020-01-22 MAC_Field_Scanner_Season_10_Range_18_Column_47"]
Insert cell
ps2map = ps2.reduce((acc, cur) => {
let { Plot, date, ...rest } = cur;
acc[`${date} ${Plot.replace(/ /g, "_")}`] = rest;
return acc;
}, {})
Insert cell
combined = {
let res = [];
for (let e of indiv) {
let plt = e.plot;
let date = e.date;
let extended = { ...e, ...ps2map[`${date} ${plt}`] };

res.push(extended);
}
return res;
}
Insert cell
ps_counts_per_genotype = combined
.filter((e) => e.F0)
.map((e) => e.genotype)
.reduce((acc, cur) => {
if (acc[cur] != undefined) {
acc[cur] += 1;
} else {
acc[cur] = 1;
}
return acc;
}, {})
Insert cell
combined
.filter((e) => e.F0)
.reduce((acc,cur) => {
},{})
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more