Warning: package 'ggpmisc' was built under R version 4.3.3
Loading required package: ggpp
Warning: package 'ggpp' was built under R version 4.3.3
Registered S3 methods overwritten by 'ggpp':
method from
heightDetails.titleGrob ggplot2
widthDetails.titleGrob ggplot2
Attaching package: 'ggpp'
The following object is masked from 'package:ggplot2':
annotate
Registered S3 method overwritten by 'ggpmisc':
method from
as.character.polynomial polynom
#install.packages("broom")library(broom)
Warning: package 'broom' was built under R version 4.3.3
Attaching package: 'ggpubr'
The following objects are masked from 'package:ggpp':
as_npc, as_npcx, as_npcy
The following object is masked from 'package:egg':
ggarrange
Warning: package 'seewave' was built under R version 4.3.3
Attaching package: 'seewave'
The following object is masked from 'package:lubridate':
duration
The following object is masked from 'package:readr':
spec
10*log10(1/100000)
[1] -50
10*log10(1.7/100000000)
[1] -77.69551
10^(-80/10)
[1] 1e-08
w=ggplot(dat, aes(y = Value, x=as.numeric(Frequency),color=Segmentacion) )+#geom_line(alpha=0.1, aes(color=group),lwd=1, show.legend = T)+geom_smooth(size=2.25,method ="lm", show.legend = T,se = T)+scale_y_continuous(limits =c(-65,-45))+scale_color_manual(name="Longitud (cm)",values =c("blue","yellow","orange","green"))+#stat_regline_equation()+theme_presentation(base_size =14) +xlab("Frecuencia (kHz)") +ylab("Sv (dB)")+scale_x_continuous(breaks =c(38,70,90,120,170,200,260))+geom_vline(xintercept =c(38,45,90,170,260),linetype =c("dashed"),color="gray")+geom_hline(yintercept =c(-70,-60,-50,-40),linetype =c("dashed"),color="gray")+#scale_color_viridis_d(option = "C")+theme(legend.title=element_blank())+theme(panel.grid.major.y =element_line(color ="gray", linetype ="dashed"))+theme(panel.grid.major.x =element_line(color ="gray", linetype ="dashed"))k=ggplot(dat, aes(y = Value, x=as.numeric(Frequency),color=Segmentacion) )+#geom_line(alpha=0.1, aes(color=group),lwd=1, show.legend = T)+geom_smooth(size=2.25,method ="gam", show.legend = F,se=T)+scale_color_manual(name="Longitud (cm)",values =c("blue","yellow","orange","green"))+#stat_regline_equation()+theme_presentation(base_size =14) +xlab("Frecuencia (kHz)") +ylab("Sv (dB)")+scale_y_continuous(limits =c(-65,-45))+scale_x_continuous(breaks =c(38,70,90,120,170,200,260))+geom_vline(xintercept =c(38,45,90,170,260),linetype =c("dashed"),color="gray")+geom_hline(yintercept =c(-70,-60,-50,-40),linetype =c("dashed"),color="gray")+#scale_color_viridis_d(option = "C")+theme(legend.title=element_blank())+theme(panel.grid.major.y =element_line(color ="gray", linetype ="dashed"))+theme(panel.grid.major.x =element_line(color ="gray", linetype ="dashed"))library(cowplot)# Crear las gráficas w y k (código que proporcionaste)# Obtener la leyenda de una de las gráficas (por ejemplo, w)legend_w <-get_legend(w)# Combinar las dos gráficas y agregar la leyendacombined_plot <-plot_grid( k +theme(legend.position ="none"), # Ocultar la leyenda de la gráfica w w +theme(legend.position ="none"), # Ocultar la leyenda de la gráfica k legend_w,ncol =3, rel_heights =c(1, 1, 1),rel_widths =c(1,1,0.35), # Ajustar las alturas relativaslabels =c("(a)", "(b)", ""), # Etiquetas de enumeraciónalign ="h"# Alinear horizontalmente las partes)# Ajustar el tamaño de la leyendacombined_plot <- combined_plot +theme(legend.text =element_text(size =19), # Tamaño del texto de la leyendalegend.title =element_text(size =19) # Tamaño del título de la leyenda)# Imprimir la figura combinadaprint(combined_plot)
library(coin)
Warning: package 'coin' was built under R version 4.3.3
Loading required package: survival
oneway_test(Value ~ group, data = dat)
Asymptotic K-Sample Fisher-Pitman Permutation Test
data: Value by
group (3.5, 4, 5, 7.5, 10.5, 11, 12, 12.5, 13, 13.5)
chi-squared = 34310, df = 9, p-value < 2.2e-16