<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>R Markdown on The Personal Website of Myosotics</title>
    <link>/tags/r-markdown/</link>
    <description>Recent content in R Markdown on The Personal Website of Myosotics</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-US</language>
    <lastBuildDate>Thu, 19 Oct 2023 00:00:00 +0000</lastBuildDate><atom:link href="/tags/r-markdown/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>在Rmarkdown中调用Python代码</title>
      <link>/blog/2023-10-19-rmarkdown-python/</link>
      <pubDate>Thu, 19 Oct 2023 00:00:00 +0000</pubDate>
      
      <guid>/blog/2023-10-19-rmarkdown-python/</guid>
      <description>在Rmarkdown中调用Python代码块需要用到reticulate包
install.packages(&amp;quot;reticulate&amp;quot;) 在我们运行python代码块之前首先需要设置好Python环境。下面我们需要指定Python路径， 在命令窗口输入where python看python的路径 接下来在R中指定Pyrhon路径
library(reticulate) use_python(&#39;E:/software/Program Files/python3.11.0&#39;) 最后即可在Rmarkdown中运行python代码块了
import numpy as np import matplotlib.pyplot as plt # 计算正弦曲线上的 x 和 y 坐标 x = np.arange(0, 3*np.pi, 0.1) y = np.sin(x) plt.title(&#39;sine wave form&#39;) # 使用 matplotlib 来绘制点 plt.plot(x, y) plt.show() </description>
    </item>
    
    <item>
      <title>Hello R Markdown</title>
      <link>/blog/2020-12-01-r-rmarkdown/</link>
      <pubDate>Tue, 01 Dec 2020 21:13:14 -0500</pubDate>
      
      <guid>/blog/2020-12-01-r-rmarkdown/</guid>
      <description>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.
You can embed an R code chunk like this:
summary(cars) ## speed dist ## Min. : 4.0 Min. : 2.00 ## 1st Qu.:12.0 1st Qu.: 26.00 ## Median :15.0 Median : 36.00 ## Mean :15.4 Mean : 42.98 ## 3rd Qu.</description>
    </item>
    
  </channel>
</rss>
