# Open a connection to IRIS DMC webservices
iris <- new("IrisClient")
starttime <- as.POSIXct("2018-01-01",tz="GMT")
endtime <- as.POSIXct("2019-01-01",tz="GMT")
network <- "TA"
station <- "M22K"
channel <- "BHZ"
result <- try(traceList <- getDataAvailability(iris,network,station,"*",channel,starttime,endtime))
if (inherits(result,"try-error")) {
message(geterrmessage())
} else {
traceList
}
Run the code above in your browser using DataLab