Advertisement
Guest User

Untitled

a guest
May 19th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.88 KB | None | 0 0
  1. # Creamos nuevo dataframe para poder mostrar mejor el gráfico ensenando la corelacion entre resolucion y ctr
  2. res_data <- all_data[,c('Label', 'resolution')]
  3. res_data$Label <- as.factor(res_data$Label)
  4. res_data$resolution <- as.factor(res_data$resolution)
  5. res_data<-res_data[!is.na(res_data$Label),]
  6. res_data<-res_data[!is.na(res_data$resolution),]
  7.  
  8. #Graficamos
  9. ggplot(res_data, aes(x=res_data$resolution, fill = Label)) +
  10.   theme_bw() +
  11.   #facet_wrap(~ Label)     # adds dependency on another column
  12.   geom_bar() +
  13.   #scale_x_continuous(breaks = seq(0,65,2)) +
  14.   #scale_y_continuous(breaks = seq(0,100,5)) +
  15.   scale_fill_discrete(labels = c("Did not click", "Clicked")) +
  16.   coord_cartesian(ylim = c(0,500000)) +  #xlim = c(0,65),
  17.   labs(y = "Count of people",
  18.        x = "Resolution of an ad (in pixels)",
  19.        title = "Conversion rate according to resolution of ad (detail)")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement