irrelevant y axis name on ggplot

Rplot

If i dont use "position=dodge" i 'm getting the actual values of no_of_rides., when use "postion=dodge" the y axis values appear like this "0e+00,2e+05". How should i rectify this?

 total_rides_v2 %>% mutate(weekday=wday(total_rides_v2$started_at,label = TRUE)) %>% group_by(member_casual,weekday) %>% summarise(no_of_rides=n(),average_duration=mean(ride_length))%>% arrange(member_casual,weekday) %>% ggplot(aes(x=weekday,y=no_of_rides,fill=member_casual))+geom_col(position = "dodge")

I don't know what you mean by irrelevant names, but if you want the number format to be changed from scientific to something else, then use the scales library and pick your preferred format:
Function reference • scales (r-lib.org)

1 Like
 total_rides_v2 %>% 
mutate(weekday=wday(total_rides_v2$started_at,label = TRUE)) %>% 
group_by(member_casual,weekday) %>% 
summarise(no_of_rides=n(),average_duration=mean(ride_length))%>% 
arrange(member_casual,weekday) %>% 

ggplot(aes(x=weekday,y=no_of_rides,fill=member_casual))+
geom_col(position = "dodge")+
scale_y_continuous(labels = function(x) format(x, scientific = FALSE)) #Try this?
1 Like

Or try this?

scale_y_continuous(labels = scales::comma)
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.