# NOT RUN {
#Set a temporal working directory:
wd <- tempdir(); wd0 <- setwd(wd)
#Create subdirectory where raw data files have to be located
dir.create(file.path(wd, "raw"))
#Extract the blended ECA&D data and station files from the example data folder
path2list<-system.file("extdata", "stations.txt", package = "INQC")
list<-readr::read_lines_raw(path2list)
readr::write_lines(list,file=paste(wd,"/raw/stations.txt",sep=""))
path2txdata<-system.file("extdata", "TX_STAID000002.txt", package = "INQC")
txdata<-readr::read_lines_raw(path2txdata)
readr::write_lines(txdata, file=paste(wd,"/raw/TX_STAID000002.txt",sep=""))
path2tndata<-system.file("extdata", "TN_STAID000002.txt", package = "INQC")
tndata<-readr::read_lines_raw(path2tndata)
readr::write_lines(tndata, file=paste(wd,"/raw/TN_STAID000002.txt",sep=""))
#Read the tn data
y<-readecad(input=path2tndata,missing= -9999)[,3:4]
options("homefolder"="./")
#Call txtnblend()
txtnblend(y,"TN_STAID000002.txt")
#Introduce error values in the tn data
y[c(1,3),2]<-100
#Call txtnblend()
txtnblend(y,"TN_STAID000002.txt")
#Return to user's working directory:
setwd(wd0)
# }
Run the code above in your browser using DataLab