Guest User

Untitled

a guest
Feb 19th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. texto <- 'Animal Time Consumo
  2. 5 1 2.53396
  3. 5 2 2.32906
  4. 5 3 2.94379
  5. 5 4 3.36162
  6. 6 1 2.89082
  7. 6 2 2.53898
  8. 6 3 2.97881
  9. 6 4 3.03876
  10. 7 1 2.81885
  11. 7 2 2.73889
  12. 7 3 2.67891
  13. 7 4 2.87885'
  14.  
  15. Consumo <- read.table(text = texto, header = TRUE)
  16. Consumo$Animal <- factor(Consumo$Animal)
  17.  
  18. Consumo$especial <- ifelse(Consumo$Animal == '7', 'especial', 'normal')
  19.  
  20. library(ggplot2)
  21. gg1 <- ggplot(data = Consumo, aes(x = Time, y = Consumo, colours=Animal)) +
  22. geom_line(aes(color = especial))
  23. gg1
  24.  
  25. gg2 <- gg1 +
  26. scale_color_manual(values = c(especial = 'red', normal = 'grey')) +
  27. guides(colour = 'none')
  28. gg2
  29.  
  30. gg2 + xlab("Time, d") +
  31. ylab("Forecast daily feed intake,kg") +
  32. theme_bw() +
  33. labs(title = "C: Current model") +
  34. theme(plot.title = element_text(face = "bold", size = 18, hjust = 0),
  35. axis.title = element_text(size = 18),
  36. axis.text = element_text(size = 14))
Add Comment
Please, Sign In to add comment