mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-06-19 21:51:20 +08:00
doc: Update r.md (#604) 99e41b2798
This commit is contained in:
10
docs/r.html
10
docs/r.html
@ -30,7 +30,7 @@
|
||||
<p>该备忘单提供了使用 R 语言的示例,涵盖 R 语言基础知识、控制流、类型、结构/类、运算符、函数方法等</p>
|
||||
</div></header><div class="menu-tocs"><div class="menu-btn"><svg aria-hidden="true" fill="currentColor" height="1em" width="1em" viewBox="0 0 16 16" version="1.1" data-view-component="true">
|
||||
<path fill-rule="evenodd" d="M2 4a1 1 0 100-2 1 1 0 000 2zm3.75-1.5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zM3 8a1 1 0 11-2 0 1 1 0 012 0zm-1 6a1 1 0 100-2 1 1 0 000 2z"></path>
|
||||
</svg></div><div class="menu-modal"><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#入门">入门</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#获取帮助">获取帮助</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#使用库">使用库</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#工作目录">工作目录</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#基础入门">基础入门</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#变量和赋值">变量和赋值</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#数据类型">数据类型</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#向量和列表">向量和列表</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#数据框data-frame">数据框(Data Frame)</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#函数">函数</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#条件语句">条件语句</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#for-循环语句">for 循环语句</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#while-循环">while 循环</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#数据读取和输出">数据读取和输出</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#清理工作空间">清理工作空间</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#图形绘制">图形绘制</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#散点图">散点图</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#直方图">直方图</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#线图">线图</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#绘制散点图">绘制散点图</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#绘制直方图">绘制直方图</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#绘制折线图">绘制折线图</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#向量">向量</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#创建向量">创建向量</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#选择向量元素">选择向量元素</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#按位置">按位置</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#按值">按值</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#命名向量">命名向量</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#重复向量的元素">重复向量的元素</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#另见">另见</a></div></div><div class="h1wrap-body"><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="入门"><a aria-hidden="true" tabindex="-1" href="#入门"><span class="icon icon-link"></span></a>入门</h2><div class="wrap-body">
|
||||
</svg></div><div class="menu-modal"><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#入门">入门</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#获取帮助">获取帮助</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#下载和使用库">下载和使用库</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#工作目录">工作目录</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#基础入门">基础入门</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#变量和赋值">变量和赋值</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#数据类型">数据类型</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#向量和列表">向量和列表</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#数据框data-frame">数据框(Data Frame)</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#函数">函数</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#条件语句">条件语句</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#for-循环语句">for 循环语句</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#while-循环">while 循环</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#数据读取和输出">数据读取和输出</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#清理工作空间">清理工作空间</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#图形绘制">图形绘制</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#散点图">散点图</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#直方图">直方图</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#线图">线图</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#绘制散点图">绘制散点图</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#绘制直方图">绘制直方图</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#绘制折线图">绘制折线图</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#向量">向量</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#创建向量">创建向量</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#选择向量元素">选择向量元素</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#按位置">按位置</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#按值">按值</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#命名向量">命名向量</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#重复向量的元素">重复向量的元素</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#另见">另见</a></div></div><div class="h1wrap-body"><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="入门"><a aria-hidden="true" tabindex="-1" href="#入门"><span class="icon icon-link"></span></a>入门</h2><div class="wrap-body">
|
||||
</div></div><div class="h2wrap-body"><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="获取帮助"><a aria-hidden="true" tabindex="-1" href="#获取帮助"><span class="icon icon-link"></span></a>获取帮助</h3><div class="wrap-body">
|
||||
<p>访问帮助文件</p>
|
||||
<pre class="language-r"><code class="language-r code-highlight"><span class="code-line">?mean
|
||||
@ -46,9 +46,15 @@
|
||||
</span><span class="code-line">class<span class="token punctuation">(</span>iris<span class="token punctuation">)</span>
|
||||
</span><span class="code-line"><span class="token comment"># 查找对象所属的类</span>
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="使用库"><a aria-hidden="true" tabindex="-1" href="#使用库"><span class="icon icon-link"></span></a>使用库</h3><div class="wrap-body">
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="下载和使用库"><a aria-hidden="true" tabindex="-1" href="#下载和使用库"><span class="icon icon-link"></span></a>下载和使用库</h3><div class="wrap-body">
|
||||
<pre class="language-r"><code class="language-r code-highlight"><span class="code-line">install.packages<span class="token punctuation">(</span><span class="token string">'dplyr'</span><span class="token punctuation">)</span>
|
||||
</span><span class="code-line"><span class="token comment"># 从 CRAN 下载并安装软件包</span>
|
||||
</span><span class="code-line">install.packages<span class="token punctuation">(</span>“BiocManager”<span class="token punctuation">)</span>
|
||||
</span><span class="code-line">library<span class="token punctuation">(</span>BiocManager<span class="token punctuation">)</span>
|
||||
</span><span class="code-line">BiocManager<span class="token operator">::</span>install<span class="token punctuation">(</span><span class="token string">"dplyr"</span><span class="token punctuation">)</span>
|
||||
</span><span class="code-line"><span class="token comment"># 使用Bioconductor的BiocManager包下载并安装软件包</span>
|
||||
</span><span class="code-line">devtools<span class="token operator">::</span>install_github<span class="token punctuation">(</span><span class="token string">"clusterProfiler"</span><span class="token punctuation">)</span>
|
||||
</span><span class="code-line"><span class="token comment"># 直接从github中下载并安装软件包</span>
|
||||
</span><span class="code-line">library<span class="token punctuation">(</span>dplyr<span class="token punctuation">)</span>
|
||||
</span><span class="code-line"><span class="token comment"># 将包加载到会话中,使所有其功能可供使用</span>
|
||||
</span><span class="code-line">dplyr<span class="token operator">::</span>select
|
||||
|
Reference in New Issue
Block a user