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
# Check label coordinates for each group#:::::::::::::::::::::::::::::::::::::::::# coord.values: label coordinate for each group. If too short, they are recycled.# group.id the id of groups as returned by ggplot_build().group_coord<-function(coord.values, group.id){
if(!.is_empty(coord.values)){
coord.values<- ifelse(length(coord.values) >=group.id,
coord.values[group.id], coord.values[1])
}
coord.values
}
in order to avoid passing in a group.id of 0 because the group data x contains 0, then causing an incredible error.(which confused me all night :-)
The problem can be reproduced like this:
First,generate group data with 0 in x (any x in (-2,1) can lead to this problem):
> data
x y group
1 0 1.1 A
2 0 1.2 A
3 0 1.3 A
4 0 1.4 A
5 3 1.5 A
6 3 1.6 A
7 3 1.7 A
8 3 1.8 A
9 0 1.1 B
10 0 1.2 B
11 0 1.3 B
12 0 1.4 B
13 3 1.5 B
14 3 1.6 B
15 3 1.7 B
16 3 1.8 B
Warning message:
Computation failed in `stat_compare_means()`
Caused by error in `purrr::map()`:
ℹ In index: 1.
Caused by error in `.check_npc_coord()`:
! '*.npc coord for x axis should be either a numeric value in [0-1] or a character strings including one of right, left, center, centre, middle
The text was updated successfully, but these errors were encountered:
In utilities_label.R:
this line
should be changed to:
in order to avoid passing in a group.id of 0 because the group data x contains 0, then causing an incredible error.(which confused me all night :-)
The problem can be reproduced like this:
First,generate group data with 0 in x (any x in (-2,1) can lead to this problem):
Then have a simple plot:
And you get it:
The text was updated successfully, but these errors were encountered: