-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoursesJH.R
More file actions
36 lines (30 loc) · 1004 Bytes
/
coursesJH.R
File metadata and controls
36 lines (30 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
dd <- read.csv("~/Downloads/hw1_data.csv")
ddd<-subset.data.frame(dd,dd$Ozone>31 & dd$Temp>90)
setwd("/Users/raf/Desktop/coursesDATA/specdata")
#################################################################################
complete <- function(directory, id = 1:332) {
## 'directory'
dir<-getwd()
directory<-read.csv(paste(dir,'/',directory,'.csv',sep=''), header = TRUE)
##id
if ( nchar(id) == 1 ) {
id <- paste("00", id, sep="")
} else if ( nchar(id) == 2 ){
id <- paste("0", id, sep="")
}
##
print(summary(datacsv))
return(datacsv)
#################################################################################
getmonitor <- function(id, directory, summarize = FALSE) {
if ( nchar(id) == 1 ) {
id <- paste("00", id, sep="")
} else if ( nchar(id) == 2 ){
id <- paste("0", id, sep="")
}
file<-id
datacsv <- read.csv(paste(directory,'/',file,'.csv',sep=''), header = TRUE)
if (summarize == TRUE)
print(summary(datacsv))
return(datacsv)
}