开发者

How to order values on a dotplot produced via qplot?

开发者 https://www.devze.com 2023-02-22 13:59 出处:网络
I generated this with qplot(log10(InDegree), username , data = df, colour = insamples). 开发者_运维问答

I generated this with qplot(log10(InDegree), username , data = df, colour = insamples).

开发者_运维问答

Is there a way I tell qplot to order the dots from lower to higher value on the y-axis?

How to order values on a dotplot produced via qplot?


The key step is to create a factor of the names with codes in the order of the values.

require(datasets); require(ggplot2)
precip2 = precip[-50]; precip2 = precip2[order(precip2)][1:20]
states = names(precip2); states = factor(states, levels=states)
qplot(precip2, states, data = d)

How to order values on a dotplot produced via qplot?

0

精彩评论

暂无评论...
验证码 换一张
取 消