Error with netVisual_aggregate in spatial data
Hi ,
Thank you for the nice package.
I have problems when I use the following code in cellchatV2, since V2 cannot ask questions, I can only ask this question here, which I feel really sorry about.
There is the question netVisual_aggregate(cellchat, signaling = pathways.show, layout = "spatial", edge.width.max = 2, vertex.size.max = 1, alpha.image = 0.2, vertex.label.cex = 3.5)
Error in geom_point():
! Problem while setting up geom aesthetics.
ℹ Error occurred in the 3rd layer.
Caused by error in check_aesthetics():
! Aesthetics must be either length 1 or the same as the data (1073).
✖ Fix the following mappings: colour.
Run rlang::last_trace() to see where the error occurred.
Backtrace:
▆
- ├─base (local)
<fn>(x) - └─ggplot2:::print.ggplot(x)
- ├─ggplot2::ggplot_build(x)
- └─ggplot2:::ggplot_build.ggplot(x)
-
└─ggplot2:::by_layer(...) -
├─rlang::try_fetch(...) -
│ ├─base::tryCatch(...) -
│ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers) -
│ │ └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]]) -
│ │ └─base (local) doTryCatch(return(expr), name, parentenv, handler) -
│ └─base::withCallingHandlers(...) -
└─ggplot2 (local) f(l = layers[[i]], d = data[[i]]) -
└─l$compute_geom_2(d) -
└─ggplot2 (local) compute_geom_2(..., self = self) -
└─self$geom$use_defaults(data, self$aes_params, modifiers) -
└─ggplot2 (local) use_defaults(..., self = self) -
└─ggplot2:::check_aesthetics(new_params, nrow(data))
I don't have this problem when using other data.The error here should be ggplot2, but I don't know where to set the color, and I don't know how to modify this error.
Do you have any thoughts on this?
Thank you so much in advance.
Save problem.
Error in geom_point():
! Problem while setting up geom aesthetics.
ℹ Error occurred in the 3rd layer.
Caused by error in check_aesthetics():
! Aesthetics must be either length 1 or the same as the data (3650).
✖ Fix the following mappings: colour.
Run rlang::last_trace() to see where the error occurred.