alan-turing-institute / eider

eider: an R package for processing health records declaratively
https://alan-turing-institute.github.io/eider/
Other
2 stars 0 forks source link

Read json string as well as file #64

Closed helendduncan closed 7 months ago

helendduncan commented 7 months ago

Add example and update logs for reading json string directly. Closes #58

helendduncan commented 7 months ago

Proposed workflow change - including with data read in

data_sources = list(
    ae2 = from_csv(“./ae2.csv”),
    smr04 = smr04
)

Users specify if file or dataframe

Or specify if reading

features = c(
   from_string(“{…}”),
   from_json(“combine.json”)
)

jsonlite function will work the same for both string and file so for this issue it would be a case of tidying up the logging etc

yongrenjie commented 7 months ago

Hi Helen — sorry just running through this very quickly before heading out to AIUK. Couple of very quick questions

  1. Could you construct an example where there are two features, one read from a JSON file and one read from a string and stick it in the docs? This is quite low priority, let me know if you'd like me to do it after we get this merged
  2. Did we decide on whether to use functions like from_string() and from_file()?
helendduncan commented 7 months ago

Hi Helen — sorry just running through this very quickly before heading out to AIUK. Couple of very quick questions

  1. Could you construct an example where there are two features, one read from a JSON file and one read from a string and stick it in the docs? This is quite low priority, let me know if you'd like me to do it after we get this merged
  2. Did we decide on whether to use functions like from_string() and from_file()?
  1. Yes. I have it partially in the ~vignette~ depreciated a&E quarto page and will ~expand~ put it in the correct place. Good call!
  2. For brevity I've left as is as the jsonlite function responds the same to string and files anyway