-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path01_rmarkdown.Rmd
More file actions
47 lines (33 loc) · 1.21 KB
/
01_rmarkdown.Rmd
File metadata and controls
47 lines (33 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
title: "Untitled"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r cars}
summary(cars)
```
## Including Plots
You can also embed plots, for example:
```{r pressure, echo=FALSE}
plot(pressure)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
```{r,include=FALSE}
library(reticulate)
library(PythonInR)
py_available()
use_condaenv("r-reticulate")
```
```{python}
import pandas
import matplotlib.pyplot as plt
from sklearn.datasets.samples_generator import make_blobs
data, target = make_blobs(n_samples=1000, n_features=2, centers=[[-2,-2],[1,1],[3,3],[5,5]], cluster_std=[0.4,0.2,0.1,0.3], random_state=7)
plt.scatter(data[:, 0], data[: ,1], c=target, marker='o')
plt.show()
```