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

Adding the tutorial "Running Python in R Markdown" #40

Merged
merged 19 commits into from
Nov 13, 2019

Conversation

raokaran
Copy link
Contributor

No description provided.

@skyetim skyetim mentioned this pull request Nov 2, 2019
@skyetim skyetim added the bug Something isn't working label Nov 2, 2019
python_r_markdown.Rmd Outdated Show resolved Hide resolved
@skyetim skyetim added changes requested bug Something isn't working and removed bug Something isn't working changes requested labels Nov 3, 2019
@raokaran
Copy link
Contributor Author

raokaran commented Nov 4, 2019

Hi, I'm unable to find the requested changes. Is there anything I should do?

@skyetim
Copy link
Collaborator

skyetim commented Nov 4, 2019

Can you see the conversation under line 114?

@raokaran
Copy link
Contributor Author

raokaran commented Nov 4, 2019

OK, as I understand it, I should add code to install pandas and seaborn. Should I create a new pull request or is there a way to update this one with a few lines of code? I think all I'm adding is:

import subprocess
import sys

def install(package):
    subprocess.call([sys.executable, "-m", "pip", "install", package])
    
install("pandas")
install("seaborn")

@skyetim
Copy link
Collaborator

skyetim commented Nov 5, 2019

you just need to push to your branch and it will be automatically reflected here.

@raokaran
Copy link
Contributor Author

raokaran commented Nov 5, 2019

I tried updating the file here on GitHub - could you tell me if it works now?

@jtr13
Copy link
Owner

jtr13 commented Nov 5, 2019

@raokaran Sorry I wasn't clear that the installation is a backend thing that needs to be done in the .travis.yml file. Unfortunately it's a bit complicated. I see three options here:

  1. Take out the examples that involve Python libraries. reticulate works fine with bookdown + Travis + GitHub Pages with no libraries, for example: https://jtr13.github.io/githubpagestest/methods.html#adding-another-language

  2. Rather than try to include your full tutorial in this bookdown book, host it on your GitHub repo using output: github_document and then provide a link to the rendered .md file and short description here. Here's an example of an .Rmd with this output format:
    https://github.com/jtr13/codehelp/blob/master/R/gather.Rmd
    and the rendered .md file: https://github.com/jtr13/codehelp/blob/master/R/gather.md

  3. On the backend, the maintainers can try to add the libraries to .travis.yml. I made some headway but got stuck on some Python 2 vs. 3 issues. This SO post might be useful: https://stackoverflow.com/questions/27644586/how-to-set-up-travis-ci-with-multiple-languages

@skyetim What do you recommend?

@skyetim
Copy link
Collaborator

skyetim commented Nov 5, 2019

I recommend the 2nd option as it's easier for @raokaran to implement.

@raokaran
Copy link
Contributor Author

raokaran commented Nov 13, 2019

Hi, I tried the second option. Could you tell me if it turned out alright?

@skyetim skyetim merged commit 501283f into jtr13:master Nov 13, 2019
@skyetim
Copy link
Collaborator

skyetim commented Nov 13, 2019

It works now! 🎉 Thanks for your contribution. It has been merged!

@raokaran
Copy link
Contributor Author

Thank you!

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

Successfully merging this pull request may close these issues.

6 participants