Skip to content

Instantly share code, notes, and snippets.

View mbjones's full-sized avatar

Matt Jones mbjones

View GitHub Profile
@mbjones
mbjones / geopackage.Rmd
Created July 23, 2021 21:47
geopackage.Rmd
---
title: "geopackage"
author: "Matt Jones"
date: "7/23/2021"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
@mbjones
mbjones / abstractlengths.Rmd
Created October 12, 2021 00:27
Abstract lengths in DataONE
---
title: "abstracts"
author: "Matt Jones"
date: "10/11/2021"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(vroom)
@mbjones
mbjones / knb-download-poc.R
Created October 26, 2023 23:42
KNB download CSV
library(dataone)
# Download a CSV-formatted data file from the KNB
# repository, and convert it to a data.frame
get_dataframe <- function(pid) {
d1c <- D1Client("PROD", "urn:node:KNB")
data_raw <- getObject(d1c@mn, pid)
data_char <- rawToChar(data_raw)
csv_text <- textConnection(data_char)
df <- read.csv(csv_text, stringsAsFactors = FALSE)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

DataONE Data Package Upload Example

Table of Contents

This is an example of how to upload content into a repository that implements the DataONE Tier 3 MNStorage API. We focus on a simple yet complete data package example that involves two CSV data files, one EML metadata file, and one OAI-ORE resource map file. This example is based on content in the following published dataset, but has some changes to simplify the example:

@mbjones
mbjones / git-reset.md
Last active May 1, 2025 07:04
git reset is my friend

git reset

I often mess up. Sometimes badly 🤯. git reset is my friend.

Here's the current state of the Metacat repo:

image

Imagine I commit a file to develop. When I look at the log, I see its gotten pretty messy, because the merge commit in main wasn't committed into develop. This makes for a messy tree.

@mbjones
mbjones / dataone-package-versions.md
Created May 8, 2025 00:01
dataone-package-versions.md
stateDiagram-v2
    direction LR
    [*] --> EML
    state EML {
        direction LR
        [*] --> A
        A --> B: obsoletedBy
        B --> C: obsoletedBy
 }