lsms-worldbank / selector

Load SuSo meta data into chars and utilities using them
https://lsms-worldbank.github.io/selector/
0 stars 0 forks source link

Provide wrapper command for creating SuSo metadata with R #21

Open arthur-shaw opened 5 months ago

arthur-shaw commented 5 months ago

Once https://github.com/lsms-worldbank/susometa/issues/9 is resovled, @kbjarkefur , would it make sense to write a wrapper function in Stata so that end users could accomplish everything (seemingly) from Stata?

kbjarkefur commented 4 months ago

I might be overly skeptical about marrying R and Stata at run time, but that is still my initial preference. However, I can see how much value that would add and is therefore probably ok to reluctantly agree to this.

We should label this as more advanced, have some disclaimers that we can't fully test an integration between R/Stata and the user is therefore needed to review the output, and also say that the recommended way is to do this in R and then import the csv to Stata.

I am warming up to this. I still think that the ultimate goal would be to have the SuSo server (optionally?) include the chars already when exporting the data from the server.

arthur-shaw commented 4 months ago

I might be overly skeptical about marrying R and Stata at run time, but that is still my initial preference.

You're not wrong about this. There's a lot that would need to be done by way of defensive programming and provisioning.

For defensive programming:

For the provisioning:

Also, we'd need to think about how to wrap the R script exactly. For sursol, a Stata-based SuSo API wrapper that leans on R, the code messily uses Stata to write an R script that the shell session then executes. See here. Otherwise, I don't know if there's any way for a Stata package to provision an R script in an acillary file that gets run via the command.

kbjarkefur commented 4 months ago

You can share an R script as an ancillary file. Or at least I think so as we are sharing python files in https://github.com/worldbank/stata-linter/tree/main/src. Maybe they see R more as a direct competitor and block it. Although this is SSC that has less skin in the game.

Running that file should be possible but not sure how to do it. Need to think more about that and the other things you are mentioning.