library(lipdR) knitr::opts_chunk$set(echo = TRUE)
lipd2neotoma()
functionFirst, we will load this record and convert into lipd format
B <- neotoma2::get_sites(sitename = "Bambili 2") D <- neotoma2::get_downloads(B) L <- neotoma2lipd(D)
Let's see a summary of the record in LiPD
summary(L)
Now we will convert back to neotoma and observe the changes
N <- lipd2neotoma(L) D@sites[[1]] N
The site printout looks good
Site level metadata
D D@sites D@sites[[1]] N D@sites[[1]]@siteid N@siteid D@sites[[1]]@sitename N@sitename D@sites[[1]]$geography N@geography D@sites[[1]]$altitude N@altitude D@sites[[1]]$geopolitical N@geopolitical D@sites[[1]]$area N@area D@sites[[1]]$notes N@notes D@sites[[1]]$description N@description D@sites[[1]]$collunits N@collunits
We do pretty good here with the exception of "geopolitical", which could be added to the lipd under "geo"
We also see an error in trying to print the "collunit", which is detailed later
D@sites[[1]]@collunits@collunits[[1]]@datasets@datasets[[1]]@samples@samples[[1]]@datum N@collunits@collunits[[1]]@datasets@datasets[[1]]@samples@samples[[1]]@datum
note that D
is the original neotoma dataset and N
is the new one
N
is a site
rather than a sites
Aside from some loss in the variablename
, these data frames look identical.
Improved variablename
fidelity is possible with alteration to the neotoma2lipd()
function
What's the difference between element and elementtype?
Let's jump to the last datum
to see if this fidelity holds
length(D@sites[[1]]@collunits@collunits[[1]]@datasets@datasets[[1]]@samples@samples) D@sites[[1]]@collunits@collunits[[1]]@datasets@datasets[[1]]@samples@samples[[140]]@datum N$collunits@collunits[[1]]@datasets@datasets[[1]]@samples@samples[[140]]@datum
again, we see some minor changes to variablename
, but otherwise the data frame is identical
Let's have a look at the chronology data
D@sites[[1]]@collunits@collunits[[1]]@chronologies@chronologies[[1]]@chroncontrols N$collunits@collunits[[1]]@chronologies@chronologies[[1]]@chroncontrols
I could not identify the sorting of the original chronology table to follow
The tables are otherwise identical
Collection unit print doesn't work
D@sites[[1]]@collunits@collunits[[1]] N$collunits@collunits[[1]] new("site") new("collunits") new("collunit")
creating a new "collunit" is an issue?
Some of the chronology metadata isn't retained, lipd doesn't store metadata at this level
D@sites[[1]]@collunits@collunits[[1]]@chronologies@chronologies[[1]] N$collunits@collunits[[1]]@chronologies@chronologies[[1]]
Same for "collunit" metadata
D@sites[[1]]@collunits@collunits[[1]] N$collunits@collunits[[1]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.