SHARE
TWEET

Untitled

a guest Feb 27th, 2020 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. plotresult <- function(file, start = 1) {
  2.     data <- read.csv(file)
  3.     data <- data[start:nrow(data),]
  4.     plot(data, type = "l")
  5. }
  6.  
  7. system("java Lab data1.txt result1.txt 600")
  8. plotresult("result1.txt")
  9.  
  10. pdf("result1.pdf")
  11. plotresult("result1.txt")
  12. dev.off()
  13.  
  14. l10 <- c()
  15. l100 <- c()
  16. for (i in 1:10){
  17.  
  18. system("java  Lab data1.txt result1.txt 600")
  19. meanFunc <- function(file) {
  20.     data <- read.csv(file)
  21.     data <- data[data > 100 ,]
  22.     completeData <- data[complete.cases(data), ]
  23.     completeData <- data.matrix(completeData[2])
  24.     mean(completeData)
  25. }
  26. mFunc <- meanFunc("result1.txt")
  27. l10[[i]] <- mFunc
  28. }
  29.  
  30.  
  31. for (i in 1:100){
  32.  
  33. system("java Lab data1.txt result1.txt 600")
  34. meanFunc <- function(file) {
  35.     data <- read.csv(file)
  36.     data <- data[data > 100 ,]
  37.     completeData <- data[complete.cases(data), ]
  38.     completeData <- data.matrix(completeData[2])
  39.     mean(completeData)
  40. }
  41. mFunc <- meanFunc("result1.txt")
  42. l100[[i]] <- mFunc
  43. }
  44. t.test(l10)
  45. t.test(l100)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top