商业预测 初识R

  1. 打开帮助文档首页,查阅其中的"Introduction to R"

help Rhelp

  1. 安装vcd包

install.packages("vcd")

  1. 列出此包中可用的函数和数据集

ls("package:vcd") / data(package = "vcd")

  1. 载入包并阅读数据集Arthritis的描述

library("v. d") / ?Arthritis

  1. 显示数据集Arthritis的内容

查看数据集结构 str(Arthritis) 查看数据集前几行 head(Arthritis)

  1. 运行该数据集自带的实例

运行数据集自带的示例

例如,使用交叉表和图形可视化

创建一个交叉表

table(ArthritisImproved, ArthritisTreatment)

绘制交叉表的条形图

mosaic(~ Improved + Treatment, data = Arthritis,

main = "WHY Test",

labeling_args = list(set_varnames = c("Improved", "Treatment")))

  1. 退出 q()
相关推荐
zhangfeng113312 小时前
BiocManager下载失败 R语言 解决办法
开发语言·r语言
Tiger Z3 天前
《R for Data Science (2e)》免费中文翻译 (第7章) --- Data import(1)
r语言·数据科学·中文翻译
魔力之心3 天前
R notes[2]
开发语言·r语言
Tiger Z5 天前
R 语言科研绘图第 71 期 --- 散点图-边际
r语言·论文·科研·绘图·研究生
小丑尽欢5 天前
R语言根据经纬度获得对应样本的省份
开发语言·r语言
czhc11400756637 天前
Linux 830 shell:expect,ss -ant ,while IFS=read -r line,
linux·运维·r语言
Morpheon7 天前
Intro to R Programming - Lesson 4 (Graphs)
开发语言·r语言
医工交叉实验工坊10 天前
R 语言 ComplexUpset 包实战:替代 Venn 图的高级集合可视化方案
算法·r语言
青春不败 177-3266-052010 天前
R语言贝叶斯方法在生态环境领域中的高阶技术应用
r语言·贝叶斯·生态学·科研绘图·结构方程·环境科学·混合效应
love530love11 天前
怎么更新 cargo.exe ?(Rust 工具链)
人工智能·windows·python·rust·r语言