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
Al generar los gráficos salta error, he probado a utilizar el .csv tanto con el paso de interpolación como sin él por si fuera la causa pero el error es el mismo.
Al generar los gráficos salta error, he probado a utilizar el .csv tanto con el paso de interpolación como sin él por si fuera la causa pero el error es el mismo.
Moving Average Smoothing parameters
MA_order <- 12
Dataframe reordering for facet plotting
df_MA <- data.frame(apply(df[,c("vt","convexity", "circularity", "major","minor")], 2, SMA, n=MA_order))
df_MA <- df_MA %>% mutate_all(funs((. - min(., na.rm = T))/(max(., na.rm = T) - min(., na.rm = T))))
df_MA_long <- melt(df_MA)
Time = rep(1:181, 5)
Plot generation
Time series trajectory
p1 <- ggplot(df, aes(x=frame, y=y)) +
geom_line() +
xlab("") +
ylab("Position (microns)") +
theme_bw() +
geom_vline(xintercept = c(best.case$end, best.case$begin),
color = "black", size=0.5)
Moving average values of each morphological descriptor and velocity
p2 <- ggplot(data=df_MA_long, aes(x=Time, y=1, fill=value, color=variable)) +
facet_wrap(~variable, ncol=1, scales='free') +
scale_fill_gradientn(colours=c("#15BFC3", "#FC367A", "white", "gray"),
na.value = "transparent",
breaks=c(0,0.5,1),labels=c(0,0.5,1),
limits=c(0,1)) +
theme_bw() +
ylab('') +
geom_raster() +
labs(fill = "Relative\nvalue") +
theme(axis.text.y=element_blank(),axis.ticks.y=element_blank()) +
geom_vline(xintercept = c(best.case$end, best.case$begin),
color = "black", size=0.5)
Arranging the plots in the same column for better visualization, using egg library.
ggarrange(p1,p2, ncol = 1,heights = c(2, 4))
Error: Aesthetics must be either length 1 or the same as the data (900): x
Traceback:
. glue_collapse(names(which(!good)), ", ", last = " and ")))
The text was updated successfully, but these errors were encountered: