Create and save to disk a single variable dataset
The daily and hourly files conatin many data elements
Typically one works with a single variable at time. This function
allows you to create subsets of data that have one and only one variable
in the file. The monolithic file, of course, can be read with
read.table. This function uses read.table, but skips the columns
not requested and writes out the subset of data
Filename of the monolithic file. for example:
CRN_Hourly_2011-09-19.dat or CRN_Daily_2011-09-19.dat.
The column names either colnamesDaily or colnamesHourly It must match the file you are reading: hourly for hourly; daily for daily
the variable you want to extract. It must be quoted exactly as it appears in the colnames constant
The function masks off all unnecessaru columns and writes a dataset. The station ID ( WBANNO) and date and time are also saved. one variable and one variable only is added to these base variables and output to the file
Side effect is a file containing all stations and the variable requested.
This only works for numeric variables and not flag data
1 2 3 4 5 6