---
title: "Introduction to rspacer"
vignette: >
  %\VignetteIndexEntry{Introduction to rspacer}
  %\VignetteEngine{quarto::html}
  %\VignetteEncoding{UTF-8}
---



The rspacer package is a wrapper for the RSpace Electronic Lab Notebook
(<https://www.researchspace.com/>) API (<https://community.researchspace.com/public/apiDocs>),
and packages provides convenience functions to browse, search, create, and edit your RSpace documents.
In addition, it enables filling RSpace templates from R Markdown/Quarto reports
or from tabular data (e.g., R data.frames/tibbles, but also Excel/CSV files).

This vignette will show you how to get started with rspacer.

## Setting up rspacer

To use rspacer it needs two things:

1. The API URL for your RSpace instance (this is typically the URL of your RSpace instance followed by `api/v1`, e.g., `https://leiden.researchspace.com/api/v1`)^[If you don't have an RSpace instance yet, you can use the <https://community.researchspace.com/> instance.]
2. Your API key, which is an authentication token you can use instead of your username and password. To create an API key go to 'Manage API Key' section of your RSpace profile page (MyRSpace -> My Profile). **You should keep your API key private.** You can regenerate an API key at any time, which will invalidate the old key.

You can use the `set_api_url()` and `set_api_key()` functions to make these available to rspacer in the current session.
To make this information persistent you can store it in environment variables. An easy way to do this is with `usethis::edit_r_environ()`; in the file that opens, you should add the following lines (insert your own URL and key):

```
RSPACE_API_URL="https://leiden.researchspace.com/api/v1"
RSPACE_API_KEY="<YOUR_API_KEY_HERE>"
```

After saving the file and restarting R, you should now be able to run


``` r
library(rspacer)
api_status()
```

```
## $message
## [1] "OK"
## 
## $rspaceVersion
## [1] "1.115.2"
```

## Functionality

### Folders

Now you can use rspacer to interact with your RSpace Workspace.
For example, `folder_tree()` will show you the content of your Workspace as a tibble:


``` r
folder_tree()
```

```
## # A tibble: 10 × 7
##        id globalId name                   created             lastModified        type     owner         
##     <int> <chr>    <chr>                  <dttm>              <dttm>              <chr>    <chr>         
##  1 356307 SD356307 Gerhard Burger         2024-01-17 14:56:22 2024-01-17 15:04:39 DOCUMENT Gerhard Burger
##  2 260004 FL260004 LACDR RDM              2023-11-06 10:19:59 2023-11-06 10:19:59 FOLDER   Gerhard Burger
##  3 242175 FL242175 GABi001_EMP_regulation 2023-05-30 10:14:51 2023-06-14 12:30:47 FOLDER   Gerhard Burger
##  4 242400 FL242400 Ontologies             2023-06-01 07:23:10 2023-06-01 07:23:10 FOLDER   Gerhard Burger
##  5 242398 FL242398 Api Inbox              2023-06-01 07:23:08 2023-06-01 07:23:08 FOLDER   Gerhard Burger
##  6 242182 FL242182 Publications           2023-05-30 11:07:25 2023-05-30 11:07:25 FOLDER   Gerhard Burger
##  7  21961 FL21961  DDS2 Data management   2023-03-16 09:50:33 2023-03-16 09:50:33 FOLDER   Gerhard Burger
##  8   7833 FL7833   Templates              2022-12-22 12:32:22 2022-12-22 12:32:22 FOLDER   Gerhard Burger
##  9   7819 GF7819   Gallery                2022-12-22 12:32:22 2022-12-22 12:32:22 FOLDER   Gerhard Burger
## 10   7814 FL7814   Shared                 2022-12-22 12:32:22 2022-12-22 12:32:22 FOLDER   Gerhard Burger
```

You can also specify an id or Unique ID (`globalId`) to show the contents of a specific folder:


``` r
folder_tree(7819)
```

```
## # A tibble: 8 × 7
##      id globalId name          created             lastModified        type   owner         
##   <int> <chr>    <chr>         <dttm>              <dttm>              <chr>  <chr>         
## 1  7828 GF7828   Snippets      2022-12-22 12:32:22 2022-12-22 12:32:22 FOLDER Gerhard Burger
## 2  7827 GF7827   PdfDocuments  2022-12-22 12:32:22 2022-12-22 12:32:22 FOLDER Gerhard Burger
## 3  7826 GF7826   Miscellaneous 2022-12-22 12:32:22 2022-12-22 12:32:22 FOLDER Gerhard Burger
## 4  7825 GF7825   Documents     2022-12-22 12:32:22 2022-12-22 12:32:22 FOLDER Gerhard Burger
## 5  7824 GF7824   Chemistry     2022-12-22 12:32:22 2022-12-22 12:32:22 FOLDER Gerhard Burger
## 6  7823 GF7823   Videos        2022-12-22 12:32:22 2022-12-22 12:32:22 FOLDER Gerhard Burger
## 7  7822 GF7822   Audios        2022-12-22 12:32:22 2022-12-22 12:32:22 FOLDER Gerhard Burger
## 8  7820 GF7820   Images        2022-12-22 12:32:22 2022-12-22 12:32:22 FOLDER Gerhard Burger
```

### Documents

#### Search

You can search for documents using the `document_search()` function:


``` r
document_search("test")
```

```
## # A tibble: 50 × 11
##        id globalId name          created             lastModified        parentFolderId grandParentId tags 
##     <int> <chr>    <chr>         <dttm>              <dttm>                       <int>         <int> <chr>
##  1 426750 SD426750 Untitled doc… 2025-11-18 14:04:50 2025-11-18 14:04:56         242398          7813 rspa…
##  2 426748 SD426748 Untitled doc… 2025-11-18 13:55:13 2025-11-18 13:55:19         242398          7813 rspa…
##  3 426716 SD426716 Untitled doc… 2025-11-18 12:15:15 2025-11-18 12:15:20         242398          7813 rspa…
##  4 426660 SD426660 251117_colle… 2025-11-17 16:13:27 2025-11-18 09:24:17             NA            NA <NA> 
##  5 426662 SD426662 251120_test_… 2025-11-17 16:17:44 2025-11-17 16:23:49             NA            NA <NA> 
##  6 424078 SD424078 test          2025-10-17 10:21:21 2025-10-17 10:21:27         242398          7813 rspa…
##  7 424072 SD424072 test          2025-10-17 09:21:55 2025-10-17 09:22:01         242398          7813 rspa…
##  8 422915 SD422915 251001_test_… 2025-09-30 08:33:22 2025-10-07 11:51:30             NA            NA <NA> 
##  9 421333 SD421333 250901_compa… 2025-09-01 09:06:12 2025-09-10 13:16:24             NA            NA <NA> 
## 10 420651 SD420651 250820_Suriv… 2025-08-19 14:34:17 2025-09-09 12:37:52             NA            NA <NA> 
## # ℹ 40 more rows
## # ℹ 3 more variables: tagMetaData <chr>, form <chr>, owner <chr>
```

#### Retrieve

You can retrieve documents using


``` r
res <- document_retrieve("SD356307")
summary(res)
```

```
##                Length Class  Mode     
## id              1     -none- numeric  
## globalId        1     -none- character
## name            1     -none- character
## created         1     -none- character
## lastModified    1     -none- character
## parentFolderId  1     -none- numeric  
## signed          1     -none- logical  
## tags            0     -none- NULL     
## tagMetaData     0     -none- NULL     
## form           10     -none- list     
## owner          10     -none- list     
## fields          8     -none- list     
## _links          1     -none- list     
## grandParentId   1     -none- numeric
```

The result is json converted to an R list, to get the field information you could use


``` r
library(tidyverse)
(res$fields |>
  fields_to_data_frame() -> res_df)
```

```
## # A tibble: 8 × 10
##        id globalId  name       type  content lastModified        columnIndex files listOfMaterials `_links`
##     <int> <chr>     <chr>      <chr> <chr>   <dttm>                    <int> <lgl> <lgl>           <lgl>   
## 1 1873444 FD1873444 Template … stri… "LACDR… 2024-01-17 14:56:22           0 NA    NA              NA      
## 2 1873445 FD1873445 Name       stri… "Gerha… 2024-01-17 14:56:39           1 NA    NA              NA      
## 3 1873446 FD1873446 Email      stri… "g.a.b… 2024-01-17 14:57:02           2 NA    NA              NA      
## 4 1873447 FD1873447 Phone      stri… ""      2024-01-17 14:56:22           3 NA    NA              NA      
## 5 1873448 FD1873448 ORCID      stri… "0000-… 2024-01-17 14:59:29           4 NA    NA              NA      
## 6 1873449 FD1873449 Address    text  "<p><a… 2024-01-17 14:57:49           5 NA    NA              NA      
## 7 1873450 FD1873450 Affiliati… stri… "Leide… 2024-01-17 14:59:13           6 NA    NA              NA      
## 8 1873451 FD1873451 Roles      text  ""      2024-01-17 14:56:22           7 NA    NA              NA
```

Since the fields typically contain HTML formatted information, this can be better displayed using the [`gt`](https://gt.rstudio.com/) package:

``` r
library(gt)
res_df |>
  gt() |>
  fmt_markdown(columns = c(content))
```

<!--html_preserve--><div id="dfnmdhbquq" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
<style>#dfnmdhbquq table {
  font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#dfnmdhbquq thead, #dfnmdhbquq tbody, #dfnmdhbquq tfoot, #dfnmdhbquq tr, #dfnmdhbquq td, #dfnmdhbquq th {
  border-style: none;
}

#dfnmdhbquq p {
  margin: 0;
  padding: 0;
}

#dfnmdhbquq .gt_table {
  display: table;
  border-collapse: collapse;
  line-height: normal;
  margin-left: auto;
  margin-right: auto;
  color: #333333;
  font-size: 16px;
  font-weight: normal;
  font-style: normal;
  background-color: #FFFFFF;
  width: auto;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #A8A8A8;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #A8A8A8;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
}

#dfnmdhbquq .gt_caption {
  padding-top: 4px;
  padding-bottom: 4px;
}

#dfnmdhbquq .gt_title {
  color: #333333;
  font-size: 125%;
  font-weight: initial;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-color: #FFFFFF;
  border-bottom-width: 0;
}

#dfnmdhbquq .gt_subtitle {
  color: #333333;
  font-size: 85%;
  font-weight: initial;
  padding-top: 3px;
  padding-bottom: 5px;
  padding-left: 5px;
  padding-right: 5px;
  border-top-color: #FFFFFF;
  border-top-width: 0;
}

#dfnmdhbquq .gt_heading {
  background-color: #FFFFFF;
  text-align: center;
  border-bottom-color: #FFFFFF;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
}

#dfnmdhbquq .gt_bottom_border {
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#dfnmdhbquq .gt_col_headings {
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
}

#dfnmdhbquq .gt_col_heading {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: normal;
  text-transform: inherit;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: bottom;
  padding-top: 5px;
  padding-bottom: 6px;
  padding-left: 5px;
  padding-right: 5px;
  overflow-x: hidden;
}

#dfnmdhbquq .gt_column_spanner_outer {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: normal;
  text-transform: inherit;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 4px;
  padding-right: 4px;
}

#dfnmdhbquq .gt_column_spanner_outer:first-child {
  padding-left: 0;
}

#dfnmdhbquq .gt_column_spanner_outer:last-child {
  padding-right: 0;
}

#dfnmdhbquq .gt_column_spanner {
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  vertical-align: bottom;
  padding-top: 5px;
  padding-bottom: 5px;
  overflow-x: hidden;
  display: inline-block;
  width: 100%;
}

#dfnmdhbquq .gt_spanner_row {
  border-bottom-style: hidden;
}

#dfnmdhbquq .gt_group_heading {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: middle;
  text-align: left;
}

#dfnmdhbquq .gt_empty_group_heading {
  padding: 0.5px;
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  vertical-align: middle;
}

#dfnmdhbquq .gt_from_md > :first-child {
  margin-top: 0;
}

#dfnmdhbquq .gt_from_md > :last-child {
  margin-bottom: 0;
}

#dfnmdhbquq .gt_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  margin: 10px;
  border-top-style: solid;
  border-top-width: 1px;
  border-top-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: middle;
  overflow-x: hidden;
}

#dfnmdhbquq .gt_stub {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-right-style: solid;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  padding-left: 5px;
  padding-right: 5px;
}

#dfnmdhbquq .gt_stub_row_group {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-right-style: solid;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  padding-left: 5px;
  padding-right: 5px;
  vertical-align: top;
}

#dfnmdhbquq .gt_row_group_first td {
  border-top-width: 2px;
}

#dfnmdhbquq .gt_row_group_first th {
  border-top-width: 2px;
}

#dfnmdhbquq .gt_summary_row {
  color: #333333;
  background-color: #FFFFFF;
  text-transform: inherit;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
}

#dfnmdhbquq .gt_first_summary_row {
  border-top-style: solid;
  border-top-color: #D3D3D3;
}

#dfnmdhbquq .gt_first_summary_row.thick {
  border-top-width: 2px;
}

#dfnmdhbquq .gt_last_summary_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#dfnmdhbquq .gt_grand_summary_row {
  color: #333333;
  background-color: #FFFFFF;
  text-transform: inherit;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
}

#dfnmdhbquq .gt_first_grand_summary_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-top-style: double;
  border-top-width: 6px;
  border-top-color: #D3D3D3;
}

#dfnmdhbquq .gt_last_grand_summary_row_top {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-style: double;
  border-bottom-width: 6px;
  border-bottom-color: #D3D3D3;
}

#dfnmdhbquq .gt_striped {
  background-color: rgba(128, 128, 128, 0.05);
}

#dfnmdhbquq .gt_table_body {
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#dfnmdhbquq .gt_footnotes {
  color: #333333;
  background-color: #FFFFFF;
  border-bottom-style: none;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
}

#dfnmdhbquq .gt_footnote {
  margin: 0px;
  font-size: 90%;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
}

#dfnmdhbquq .gt_sourcenotes {
  color: #333333;
  background-color: #FFFFFF;
  border-bottom-style: none;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
}

#dfnmdhbquq .gt_sourcenote {
  font-size: 90%;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
}

#dfnmdhbquq .gt_left {
  text-align: left;
}

#dfnmdhbquq .gt_center {
  text-align: center;
}

#dfnmdhbquq .gt_right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#dfnmdhbquq .gt_font_normal {
  font-weight: normal;
}

#dfnmdhbquq .gt_font_bold {
  font-weight: bold;
}

#dfnmdhbquq .gt_font_italic {
  font-style: italic;
}

#dfnmdhbquq .gt_super {
  font-size: 65%;
}

#dfnmdhbquq .gt_footnote_marks {
  font-size: 75%;
  vertical-align: 0.4em;
  position: initial;
}

#dfnmdhbquq .gt_asterisk {
  font-size: 100%;
  vertical-align: 0;
}

#dfnmdhbquq .gt_indent_1 {
  text-indent: 5px;
}

#dfnmdhbquq .gt_indent_2 {
  text-indent: 10px;
}

#dfnmdhbquq .gt_indent_3 {
  text-indent: 15px;
}

#dfnmdhbquq .gt_indent_4 {
  text-indent: 20px;
}

#dfnmdhbquq .gt_indent_5 {
  text-indent: 25px;
}

#dfnmdhbquq .katex-display {
  display: inline-flex !important;
  margin-bottom: 0.75em !important;
}

#dfnmdhbquq div.Reactable > div.rt-table > div.rt-thead > div.rt-tr.rt-tr-group-header > div.rt-th-group:after {
  height: 0px !important;
}
</style>
<table class="gt_table" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
  <thead>
    <tr class="gt_col_headings">
      <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" scope="col" id="id">id</th>
      <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="globalId">globalId</th>
      <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="name">name</th>
      <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="type">type</th>
      <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="content">content</th>
      <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" scope="col" id="lastModified">lastModified</th>
      <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" scope="col" id="columnIndex">columnIndex</th>
      <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" scope="col" id="files">files</th>
      <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" scope="col" id="listOfMaterials">listOfMaterials</th>
      <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" scope="col" id="_links">_links</th>
    </tr>
  </thead>
  <tbody class="gt_table_body">
    <tr><td headers="id" class="gt_row gt_right">1873444</td>
<td headers="globalId" class="gt_row gt_left">FD1873444</td>
<td headers="name" class="gt_row gt_left">Template Used</td>
<td headers="type" class="gt_row gt_left">string</td>
<td headers="content" class="gt_row gt_left"><span class='gt_from_md'>LACDR-ISA - Contact v0.2.0</span></td>
<td headers="lastModified" class="gt_row gt_right">2024-01-17 14:56:22.625</td>
<td headers="columnIndex" class="gt_row gt_right">0</td>
<td headers="files" class="gt_row gt_center">NA</td>
<td headers="listOfMaterials" class="gt_row gt_center">NA</td>
<td headers="_links" class="gt_row gt_center">NA</td></tr>
    <tr><td headers="id" class="gt_row gt_right">1873445</td>
<td headers="globalId" class="gt_row gt_left">FD1873445</td>
<td headers="name" class="gt_row gt_left">Name</td>
<td headers="type" class="gt_row gt_left">string</td>
<td headers="content" class="gt_row gt_left"><span class='gt_from_md'>Gerhard A. Burger</span></td>
<td headers="lastModified" class="gt_row gt_right">2024-01-17 14:56:39.641</td>
<td headers="columnIndex" class="gt_row gt_right">1</td>
<td headers="files" class="gt_row gt_center">NA</td>
<td headers="listOfMaterials" class="gt_row gt_center">NA</td>
<td headers="_links" class="gt_row gt_center">NA</td></tr>
    <tr><td headers="id" class="gt_row gt_right">1873446</td>
<td headers="globalId" class="gt_row gt_left">FD1873446</td>
<td headers="name" class="gt_row gt_left">Email</td>
<td headers="type" class="gt_row gt_left">string</td>
<td headers="content" class="gt_row gt_left"><span class='gt_from_md'><a href="mailto:g.a.burger@lacdr.leidenuniv.nl">g.a.burger@lacdr.leidenuniv.nl</a></span></td>
<td headers="lastModified" class="gt_row gt_right">2024-01-17 14:57:02.811</td>
<td headers="columnIndex" class="gt_row gt_right">2</td>
<td headers="files" class="gt_row gt_center">NA</td>
<td headers="listOfMaterials" class="gt_row gt_center">NA</td>
<td headers="_links" class="gt_row gt_center">NA</td></tr>
    <tr><td headers="id" class="gt_row gt_right">1873447</td>
<td headers="globalId" class="gt_row gt_left">FD1873447</td>
<td headers="name" class="gt_row gt_left">Phone</td>
<td headers="type" class="gt_row gt_left">string</td>
<td headers="content" class="gt_row gt_left"><span class='gt_from_md'></span></td>
<td headers="lastModified" class="gt_row gt_right">2024-01-17 14:56:22.625</td>
<td headers="columnIndex" class="gt_row gt_right">3</td>
<td headers="files" class="gt_row gt_center">NA</td>
<td headers="listOfMaterials" class="gt_row gt_center">NA</td>
<td headers="_links" class="gt_row gt_center">NA</td></tr>
    <tr><td headers="id" class="gt_row gt_right">1873448</td>
<td headers="globalId" class="gt_row gt_left">FD1873448</td>
<td headers="name" class="gt_row gt_left">ORCID</td>
<td headers="type" class="gt_row gt_left">string</td>
<td headers="content" class="gt_row gt_left"><span class='gt_from_md'>0000-0003-1062-5576</span></td>
<td headers="lastModified" class="gt_row gt_right">2024-01-17 14:59:29.511</td>
<td headers="columnIndex" class="gt_row gt_right">4</td>
<td headers="files" class="gt_row gt_center">NA</td>
<td headers="listOfMaterials" class="gt_row gt_center">NA</td>
<td headers="_links" class="gt_row gt_center">NA</td></tr>
    <tr><td headers="id" class="gt_row gt_right">1873449</td>
<td headers="globalId" class="gt_row gt_left">FD1873449</td>
<td headers="name" class="gt_row gt_left">Address</td>
<td headers="type" class="gt_row gt_left">text</td>
<td headers="content" class="gt_row gt_left"><span class='gt_from_md'><a href="https://www.universiteitleiden.nl/en/locations/gorlaeus-building">Gorlaeus Building</a><br />Einsteinweg&nbsp;55<br />2333 CC&nbsp;Leiden<br />Room number&nbsp;GE2.05</span></td>
<td headers="lastModified" class="gt_row gt_right">2024-01-17 14:57:49.379</td>
<td headers="columnIndex" class="gt_row gt_right">5</td>
<td headers="files" class="gt_row gt_center">NA</td>
<td headers="listOfMaterials" class="gt_row gt_center">NA</td>
<td headers="_links" class="gt_row gt_center">NA</td></tr>
    <tr><td headers="id" class="gt_row gt_right">1873450</td>
<td headers="globalId" class="gt_row gt_left">FD1873450</td>
<td headers="name" class="gt_row gt_left">Affiliation</td>
<td headers="type" class="gt_row gt_left">string</td>
<td headers="content" class="gt_row gt_left"><span class='gt_from_md'>Leiden University</span></td>
<td headers="lastModified" class="gt_row gt_right">2024-01-17 14:59:13.433</td>
<td headers="columnIndex" class="gt_row gt_right">6</td>
<td headers="files" class="gt_row gt_center">NA</td>
<td headers="listOfMaterials" class="gt_row gt_center">NA</td>
<td headers="_links" class="gt_row gt_center">NA</td></tr>
    <tr><td headers="id" class="gt_row gt_right">1873451</td>
<td headers="globalId" class="gt_row gt_left">FD1873451</td>
<td headers="name" class="gt_row gt_left">Roles</td>
<td headers="type" class="gt_row gt_left">text</td>
<td headers="content" class="gt_row gt_left"><span class='gt_from_md'></span></td>
<td headers="lastModified" class="gt_row gt_right">2024-01-17 14:56:22.625</td>
<td headers="columnIndex" class="gt_row gt_right">7</td>
<td headers="files" class="gt_row gt_center">NA</td>
<td headers="listOfMaterials" class="gt_row gt_center">NA</td>
<td headers="_links" class="gt_row gt_center">NA</td></tr>
  </tbody>
  
  
</table>
</div><!--/html_preserve-->


#### Create

To create a document you need to specify name and content of the fields to be created.
The simplest way to do this is specify these in tabular form:


``` r
doc_df_to_upload <- tribble(
~name, ~content,
"Example field", "Example content"
)
document_create_from_tabular(df = doc_df_to_upload, document_name = "Example document")
```

```
## Document created: <https://leiden.researchspace.com/globalId/SD426761>
```

Support for multiple fields is supported if a compatible RSpace template
is provided with the `template_id` argument; if `template_id = NULL` all fields
will be concatenated into a single field using the field names as section headers.
The Articles tab contains more detailed instructions on how to create more structured
documents in RSpace using the rspacer `document_create_*` functions and their arguments.

##### The `rspacer` document tag

By default rspacer tags all RSpace documents created/updated using rspacer
functions with the `rspacer` tag. To disable this^[this might be necessary on
instances that enforce controlled vocabularies for tags], use the following code:


``` r
options(rspacer.set_rspacer_tag = F)
```

