R ggplot2 boxplot not properly shown when knitting html -


tried boxplot ggplo2

ggplot(aes(x = quality, y = residual.sugar),data=data)+   geom_boxplot(fill="#9999cc")+scale_y_continuous(limits =c (0,20)) 

when exucute in r itself, looks want , this: enter image description here

but when knit html file, looks :

enter image description here

anyone knows how fix that? confused :(

the difference forgot make quality factor within rmd file.

for example:

set.seed(101) dd <- data.frame(quality = sample(6:9,size=200,replace=true),                  residual.sugar = rnorm(200))  library(ggplot2) ggplot(aes(x = quality, y = residual.sugar),data=dd)+    geom_boxplot() 

enter image description here

dd2 <- transform(dd,quality=factor(quality)) ggplot(aes(x = quality, y = residual.sugar),data=dd2)+    geom_boxplot() 

enter image description here


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -