Guest User

Untitled

a guest
Jul 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. tool <- readline(prompt='Enter a Barcode: ')
  2. if (! tool %in% df$Barcode.Number) {
  3. message("Barcodes not found.")
  4. } else {
  5. initials <- readline(prompt='Enter your Initials: ')
  6. job <- readline(prompt='Enter job number: ')
  7. suppressMessages(library(dplyr))
  8. message("Good to Go!")
  9. df[df$Barcode.Number == tool, "DATE"] = as.character(Sys.Date())
  10. df[df$Barcode.Number == tool, 'Initial'] = initials
  11. df[df$Barcode.Number == tool, 'Job.Number'] = job
  12. df1 <- df %>% filter(df$Barcode.Number == tool) %>%
  13. select(Type.Equipment, Location)
  14. print(df1)
  15. df[df$Barcode.Number == tool, "Usage"] = df[df$Barcode.Number ==
  16. tool, "Usage"] + 0.5
  17. df$Status <- ifelse((df$Usage %% 1) , 'Out', 'In')
  18. }
  19.  
  20. Barcode.Number Type.Equipment Manufacture Times.Used Initials Job
  21. 4041 Flashlight Surefire 1 GP 0
  22. 4680 Capstan Honda 1 GP 0
  23. 4682 Deep Cut Band Saw Milwaukee 1 GP 0
  24.  
  25. getnumbers = function(){
  26. tool <- readline(prompt='Enter the Barcodes: ')
  27. tools <-scan(text=tool,quiet=TRUE,sep=",")
  28. cat("Your tools are:",tools)
  29. invisible(tools)
Add Comment
Please, Sign In to add comment