We provide examples of customizing data generation in causl
and calling the function in Python.
Ensure you have installed the Python package rpy2
. If it’s not already installed, run:
pip install rpy2
You’ll need two files:
1. An .R
file that defines and wraps the data-generation process.
- Make sure the function returns the simulated data.
- Expose any parameters you’d like to customize as function arguments so you can specify them when calling from Python.
- See data_causl.R
in this folder for an example.
.py
file that defines the Python function for passing those parameters.data_causl.py
in this folder for an example.Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.