Skip to content

Export a list of object of all the indices for use in Python #72

@andrew-edwards

Description

@andrew-edwards

Quite a few requests for this, and it might well be fairly simple. Can then just push the file to GitHub and Python users can download it.

From https://stackoverflow.com/questions/56681202/how-to-save-a-list-as-a-file-in-r-in-order-to-read-it-in-python :


This is pretty much what JSON is for. Do the following in R, where l is your list:

library(jsonlite)
write_json(l, "test.json")

And then do this in Python:

import json
with open("test.json") as f:
    l = json.load(f)

@schckngs - this should work, yes?

  • Andy do this in data-raw/coastwide-indices/coastwide-indices.R
  • Andrea can then test the file in Python (please!)
  • Push file and add a pacea for Python users note to README

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions