title: R package to go from CSV to CSVW JSON-LD
body: <p>I have a dataframe (or a csv file I suppose) like this:</p>
  <pre><code>&quot;Financial Institution&quot;,&quot;Rate&quot;,&quot;Insured By&quot;
  Saven Financial,1.55,FSRA
  Neo Financial,1.55,CDIC
  </code></pre>
  <p>I wish to convert this to a CSVW JSON-LD format as per this article on <a href="https://developers.google.com/search/docs/data-types/dataset#approach" rel="nofollow noreferrer">tabular data</a>.</p>
  <p>I've hand coded a version in Rmarkdown. See below.
  Is there an R package that makes this transformation easy?</p>
  <pre><code>---
    title: &quot;Structured Demo 3 - Test&quot;
  ---
  
  &lt;script type=&quot;application/ld+json&quot;&gt;  
  {
    &quot;@context&quot;: &quot;http://schema.org&quot;,
    &quot;@type&quot;: &quot;Dataset&quot;,
    &quot;name&quot;:&quot;Canadian High-Interest Savings Accounts&quot;,
    &quot;description&quot;: &quot;Up-to-date and unbiased table of rates of high-interest savings accounts from Canadian banks and credit unions along with their insurer.&quot;,
    &quot;publisher&quot;: {
      &quot;@type&quot;: &quot;Organization&quot;,
      &quot;name&quot;: &quot;Company X&quot;
    },
    &quot;mainEntity&quot; : {
      &quot;@type&quot; : &quot;csvw:Table&quot;,
      &quot;csvw:tableSchema&quot;: {
        &quot;csvw:columns&quot;: [
          {
            &quot;csvw:name&quot;: &quot;Financial Institution&quot;,
            &quot;csvw:datatype&quot;: &quot;string&quot;,
            &quot;csvw:cells&quot;: [
              {
                &quot;csvw:value&quot;: &quot;Saven Financial&quot;,
                &quot;csvw:primaryKey&quot;: &quot;Saven Financial&quot;
              },
              {
                &quot;csvw:value&quot;: &quot;Neo Financial&quot;,
                &quot;csvw:primaryKey&quot;: &quot;Neo Financial&quot;
              }]
          },
          {
            &quot;csvw:name&quot;: &quot;Rate&quot;,
            &quot;csvw:datatype&quot;: &quot;string&quot;,
            &quot;csvw:cells&quot;: [
              {
                &quot;csvw:value&quot;: &quot;1.55&quot;,
                &quot;csvw:primaryKey&quot;: &quot;Saven Financial&quot;
              },
              {
                &quot;csvw:value&quot;: &quot;1.55&quot;,
                &quot;csvw:primaryKey&quot;: &quot;Neo Financial&quot;
              }]
          },
          {
            &quot;csvw:name&quot;: &quot;Insured By&quot;,
            &quot;csvw:datatype&quot;: &quot;string&quot;,
            &quot;csvw:cells&quot;: [
              {
                &quot;csvw:value&quot;: &quot;FSRA&quot;,
                &quot;csvw:primaryKey&quot;: &quot;Saven Financial&quot;
              },
              {
                &quot;csvw:value&quot;: &quot;CDIC&quot;,
                &quot;csvw:primaryKey&quot;: &quot;Neo Financial&quot;
              }]
          }]
      }
    }
  }
  &lt;/script&gt;
  </code></pre>