小编ark*_*rks的帖子

使用 ggplot Boxplot 按年份绘制多个分布

在此输入图像描述

我正在尝试在类似于此的箱线图中评估上述数据:https://www.r-graph-gallery.com/89-box-and-scatter-plot-with-ggplot2.html

文本

我希望 x 轴反映我的“年份”变量,并且每个箱线图将 8 种方法评估为分布。最终我想确定与该分布相关的“选定”变量,但目前我只想渲染这个东西!

我弄清楚如何编码我的 y 变量,但无论我尝试什么,我都会遇到各种错误。我认为 PY 需要是 as.factor 但我已经尝试过一些这样的代码,但我只是得到了其他错误。

无论如何,这是我的代码(发送帮助):

# Libraries

library(tidyverse)
library(hrbrthemes)
library(viridis)
library(ggplot2)
library(readxl) # For reading in Excel files
library(lubridate) # For handling dates
library(dplyr) # for mutate and pipe functions

# Path to current and prior data folders
DataPath_Current <- "C:/R Projects/Box Plot Test"

Ult_sum <- read_excel(path = paste0(DataPath_Current, "/estimate.XLSX"), 
                                           sheet = "Sheet1",
                                           range = "A2:J12",
                                           guess_max = 100)

# just want to see what my table looks like
Ult_sum …
Run Code Online (Sandbox Code Playgroud)

r ggplot2 boxplot

0
推荐指数
1
解决办法
1861
查看次数

标签 统计

boxplot ×1

ggplot2 ×1

r ×1