Folioevanzhou.org
← 返回 Tessera
原样30 行 × 2 列0 KB无缺失数据 2026-08-11

plant_growth

Dried weight of thirty plants under a control and two treatment conditions.

One row represents one plant.

R package · 收录于 2026-08-11

下载 CSV · 0 KB
数据预览前 6 行
weightgroup
4.17ctrl
5.58ctrl
5.18ctrl
6.11ctrl
4.5ctrl
4.61ctrl
变量2 列
字符型1双精度1
类型
#变量类型缺失统计
1weightkeyDried plant weight.双精度—min 3.59q1 —中位 5.15均值 5.07q3 —max 6.31
2groupctrl is the control. trt1 and trt2 are the two treatments.字符型—不同值 3ctrl · trt1 · trt2
载入已写好列类型
library(readr)

plant_growth <- read_csv(
  "https://assets.evanzhou.org/tessera/csv/plant_growth.csv",
  col_types = cols(
    weight = col_double(),
    group  = col_character()
  )
)
URLhttps://assets.evanzhou.org/tessera/csv/plant_growth.csv

Source

R 自带的 datasets::PlantGrowth。三十株植物分为对照、处理 1 和处理 2 三组,每组十条,响应变量是植物干重。

这里的 CSV 由 R 4.5.1 自带数据原样导出;实验出处与示例见 R 官方文档。

Use cases

  • 箱线图:比较三个处理组的中位数与四分位范围
  • 小提琴 + 原始点:同时看分布形态与全部观测
  • 均值误差图:展示组间平均水平及不确定性
生成脚本R · 18 行
# 产物写到 ../csv/plant_growth.csv —— 脚本和 CSV 是 content/tessera/data/ 下固定的兄弟目录,
# 所以按脚本自身定位,不依赖你在哪个目录敲这条命令。csv/ 不进仓库(见 .gitignore)。
#
# Rscript 时路径在 --file= 里,source() 时在 sys.frame()$ofile 里,两种都要认:
# 只取其中一种的话,另一种跑法会静默地把 CSV 写到当前目录去。
script_dir <- local({
  arg <- grep("^--file=", commandArgs(trailingOnly = FALSE), value = TRUE)
  path <- if (length(arg)) sub("^--file=", "", arg[[1L]]) else sys.frame(1)$ofile
  dirname(normalizePath(path, mustWork = TRUE))
})
out_csv <- file.path(script_dir, "..", "csv", "plant_growth.csv")
dir.create(dirname(out_csv), recursive = TRUE, showWarnings = FALSE)

write.csv(
  datasets::PlantGrowth,
  out_csv,
  row.names = FALSE
)

表中统计由 scripts/profile_dataset.py 于 2026-08-11 数出。