--- title: "RMarkdown Python Integration" author: "Morteza Ansarinia <morteza.ansarinia@uni.lu>" date: "11/26/2019" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) knitr::opts_knit$set(root.dir = "/") library(reticulate) use_condaenv("miniconda3", conda = "auto", required = T) ``` ## Python Markdown This is a Python Markdown document. ```python import pandas as pd import numpy as np print('I am generated in a Python code!') print('cars',r.cars.head()) ``` ```r summary(cars) ``` ## Matplotlib Plots Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot. ```{python} import numpy as np import matplotlib.pyplot as plt x = np.random.sample(100) plt.plot(x) ```