{"action":"opened","issue":{"url":"https://api.github.com/repos/estemc/Programming-Assignment-2-R-pogramming/issues/1","labels_url":"https://api.github.com/repos/estemc/Programming-Assignment-2-R-pogramming/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/estemc/Programming-Assignment-2-R-pogramming/issues/1/comments","events_url":"https://api.github.com/repos/estemc/Programming-Assignment-2-R-pogramming/issues/1/events","html_url":"https://github.com/estemc/Programming-Assignment-2-R-pogramming/issues/1","id":59410201,"number":1,"title":"pollutantmean.R","user":{"login":"estemc","id":10532166,"avatar_url":"https://avatars.githubusercontent.com/u/10532166?v=3","gravatar_id":"","url":"https://api.github.com/users/estemc","html_url":"https://github.com/estemc","followers_url":"https://api.github.com/users/estemc/followers","following_url":"https://api.github.com/users/estemc/following{/other_user}","gists_url":"https://api.github.com/users/estemc/gists{/gist_id}","starred_url":"https://api.github.com/users/estemc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/estemc/subscriptions","organizations_url":"https://api.github.com/users/estemc/orgs","repos_url":"https://api.github.com/users/estemc/repos","events_url":"https://api.github.com/users/estemc/events{/privacy}","received_events_url":"https://api.github.com/users/estemc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-01T18:10:41Z","updated_at":"2015-03-01T18:10:41Z","closed_at":null,"body":"setwd(\"C:/Users/.../specdata\")\r\nfull<-data.frame()\r\nallFiles <- list.files(pattern=\"*.csv\")\r\npollutantmean<- function(directory,pollutant,id=1:332){\r\n  for (i in id) {\r\n    full <- rbind(full,read.csv(allFiles[i]))\r\n  }\r\n  if (pollutant == \"sulfate\"){\r\n    return(mean(full$sulfate, na.rm=TRUE))}\r\n  else if (pollutant == \"nitrate\"){\r\n    return(mean(full$nitrate, na.rm=TRUE))}\r\n}"}}