R axis transformation language 13-

Some of the long tail very discrete data, eventually even an order of magnitude higher

Thus, the need to convert the data - to shorten the tail

Standard deviation in order to see, so that it becomes possible normal / normal distribution is very similar, and thus the use of a recursive linear modeling or other means

There are two ways to transform:

  • Variables used in the wrapper
qplot(x=log(friend_count),data = pf)

qplot(x=sqrt(friend_count),data = pf)

Disadvantages: the x-axis value will be changed accordingly

  • Use scale layer
ggplot(aes(x = friend_count), data = pf) + geom_histogram() + scale_x_log10()

ggplot(aes(x = friend_count), data = pf) + geom_histogram() + scale_x_sqrt()

Advantages: the x-axis value remains the original value

Published 13 original articles · won praise 0 · Views 112

Guess you like

Origin blog.csdn.net/xiuxiuxiu666/article/details/104238876