Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make your R tutorials interactive #1695

Open
metricoder opened this issue Dec 15, 2024 · 0 comments
Open

Make your R tutorials interactive #1695

metricoder opened this issue Dec 15, 2024 · 0 comments

Comments

@metricoder
Copy link

metricoder commented Dec 15, 2024

Would it be helpful to add an interactive R compiler to your tutorials? Here’s an example iframe code that could easily be embedded to allow readers to run R scripts directly?

<iframe id="compiler1" width="100%"  frameborder="0" src="https://metricgate.com/r-compiler/?rscript=%23%20R%20Code%20for%20Cumulative%20Frequency%0Afreq_table%20%3C-%20table%28mtcars%24cyl%29%0Acum_freq%20%3C-%20cumsum%28freq_table%29%0Acum_freq"></iframe>
    <script>
        const iframe = document.getElementById('compiler1');
        window.addEventListener('message', (event) => {
            if (event.data.type === 'setHeight') iframe.style.height = event.data.height + 'px';
        });
    </script>

Feel free to try it out and let me know if you’d like assistance setting it up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant