You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, there seems to be some issue in putting these two plots together. Is there a way for me to run debug() on the + operator to further investigate what might be going wrong?
library(palmerpenguins)
library(dplyr)
#> #> Attaching package: 'dplyr'#> The following objects are masked from 'package:stats':#> #> filter, lag#> The following objects are masked from 'package:base':#> #> intersect, setdiff, setequal, union
library(tidyr)
data(penguins, package="palmerpenguins")
peng<-penguins|>
rename(
bill_length=bill_length_mm,
bill_depth=bill_depth_mm,
flipper_length=flipper_length_mm,
body_mass=body_mass_g
) |>
mutate(species= as.factor(species),
island= as.factor(island),
sex= as.factor(substr(sex,1,1))) |>tidyr::drop_na()
library(ggdensity)
#> Loading required package: ggplot2
library(patchwork)
p1<- ggplot(peng,
aes(x=bill_length, y=bill_depth,
color=species)) +
geom_smooth(method="lm", se=FALSE, linewidth=2)
p2<- ggplot(peng,
aes(x=bill_length, y=bill_depth,
color=species, fill=species)) +
geom_smooth(method="lm", se=FALSE, linewidth=2)
p1+p2#> `geom_smooth()` using formula = 'y ~ x'#> Error in Ops.data.frame(guide_loc, panel_loc): '==' only defined for equally-sized data framesp1|p2#> `geom_smooth()` using formula = 'y ~ x'#> Error in Ops.data.frame(guide_loc, panel_loc): '==' only defined for equally-sized data framesp1/p2#> `geom_smooth()` using formula = 'y ~ x'#> Error in Ops.data.frame(guide_loc, panel_loc): '==' only defined for equally-sized data frames
Hello, there seems to be some issue in putting these two plots together. Is there a way for me to run
debug()
on the+
operator to further investigate what might be going wrong?Created on 2024-10-09 with reprex v2.0.2
Session info
The text was updated successfully, but these errors were encountered: