To use this program, follow these steps:
  1. Open a text editor
  2. COPY the program below and PASTE it into the editor window
  3. Edit the program so that the "PUT-LOCAL-PATH-TO-DATA-FILE-HERE" specification points to where the data file is stored on your system
  4. SELECT ALL and COPY the program then PASTE it into your R console
The program is below this line. If no program is listed, the URL to the EML document may be in error. If the EML file does not include all the information needed, the SAS program will have errors or be incomplete.

# Package ID: knb-lter-vcr.25.6 Cataloging System:VCR.
# Data set title: Hourly Meteorological Data for the Virginia Coast Reserve LTER .
# Data set creator:  John Porter -  
# Data set creator:  David Krovetz -  
# Data set creator:  William Nuttle -  
# Data set creator:  James Spitler -  
#  Metadata Provider:    - Virginia Coast Reserve Long-Term Ecological Research Project 
#  Contact:  John Porter -    - jhp7e@virginia.edu
#  Contact:    - Information manager - Virginia Coast Reserve Long-Term Ecological Research Project   - jporter@lternet.edu 
# You should replace 'PUT-LOCAL-PATH-TO-DATA-FILE-HERE'  (below) with the appropriate path.   
#   to your data file (e.g., c:\mydata\datafile.txt).                         
infile1  <- file("PUT-LOCAL-PATH-TO-DATA-FILE-HERE", open="r")  
 dataTable1 <-read.csv(infile1, 
            ,sep=","  
                ,quot='"' 
        , col.names=c(
                    "STATION",     
                    "YEAR",     
                    "MONTH",     
                    "DAY",     
                    "TIME",     
                    "PPT",     
                    "AVG_T",     
                    "MIN_T",     
                    "MAX_T",     
                    "AVG_RH",     
                    "MIN_RH",     
                    "MAX_RH",     
                    "AVG_WS",     
                    "AVG_WANG",     
                    "STD_WANG",     
                    "RAD_SOL",     
                    "PAR",     
                    "SOIL_T"    ), check.names=TRUE)

               

 
tmp_var <- character()
tmp_label <- character()
                       tmp_var <- c(tmp_var , "STATION") 
                       tmp_label <- c(tmp_label , "Climate Station Name- ")
                       tmp_var <- c(tmp_var , "YEAR") 
                       tmp_label <- c(tmp_label , "YEAR- none")
                       tmp_var <- c(tmp_var , "MONTH") 
                       tmp_label <- c(tmp_label , "MONTH- none")
                       tmp_var <- c(tmp_var , "DAY") 
                       tmp_label <- c(tmp_label , "DAY- none")
                       tmp_var <- c(tmp_var , "TIME") 
                       tmp_label <- c(tmp_label , "Eastern Standard Time- HHMM")
                       tmp_var <- c(tmp_var , "PPT") 
                       tmp_label <- c(tmp_label , "Precipitation- mm")
                       tmp_var <- c(tmp_var , "AVG_T") 
                       tmp_label <- c(tmp_label , "Average Hourly Temperature- degrees-C")
                       tmp_var <- c(tmp_var , "MIN_T") 
                       tmp_label <- c(tmp_label , "Hourly Minimum Temperature- degrees-C")
                       tmp_var <- c(tmp_var , "MAX_T") 
                       tmp_label <- c(tmp_label , "Hourly Maximum Temperature- degrees-C")
                       tmp_var <- c(tmp_var , "AVG_RH") 
                       tmp_label <- c(tmp_label , "Average Relative Humidity- percent")
                       tmp_var <- c(tmp_var , "MIN_RH") 
                       tmp_label <- c(tmp_label , "Minimum Hourly Relative Humidity- percent")
                       tmp_var <- c(tmp_var , "MAX_RH") 
                       tmp_label <- c(tmp_label , "Maximum Hourly Relative Humidity- percent")
                       tmp_var <- c(tmp_var , "AVG_WS") 
                       tmp_label <- c(tmp_label , "Average Wind Speed- m/sec")
                       tmp_var <- c(tmp_var , "AVG_WANG") 
                       tmp_label <- c(tmp_label , "Average Wind Angle- degrees")
                       tmp_var <- c(tmp_var , "STD_WANG") 
                       tmp_label <- c(tmp_label , "Standard Deviation of Wind Direction- degrees")
                       tmp_var <- c(tmp_var , "RAD_SOL") 
                       tmp_label <- c(tmp_label , "Solar Radiation- KJoules/m2")
                       tmp_var <- c(tmp_var , "PAR") 
                       tmp_label <- c(tmp_label , "Photosynthetically Active Radiation- uein/m2")
                       tmp_var <- c(tmp_var , "SOIL_T") 
                       tmp_label <- c(tmp_label , "Average Hourly Soil Temperature (10 cm depth)- ")
labelFrame1<-data.frame(variable=tmp_var, label=tmp_label)
rm(tmp_var, tmp_label)        
 

tmp_var <- character()
tmp_code <- character()                
tmp_label <- character() 
tmp_var <- c(tmp_var,"STATION")   
tmp_code <- c(tmp_code,"BRNV")   
tmp_label <- c(tmp_label,"Brownsville in Nassawadox, VA on TNC Brownsville Farm")  
tmp_var <- c(tmp_var,"STATION")   
tmp_code <- c(tmp_code,"HOGI")   
tmp_label <- c(tmp_label,"Hog Island, VA, in island center near cross island road")  
tmp_var <- c(tmp_var,"STATION")   
tmp_code <- c(tmp_code,"OYSM")   
tmp_label <- c(tmp_label,"Oyster, VA at LTER Lab in Shirley House, Rt 600")  
tmp_var <- c(tmp_var,"STATION")   
tmp_code <- c(tmp_code,"PHCK")   
tmp_label <- c(tmp_label,"Phillips Creek Marsh, Nassawadox, VA")  
codeLabelFrame1 <- data.frame(variable=tmp_var, code=tmp_code, label=tmp_label) 
rm(tmp_var, tmp_label, tmp_code) 
                
# HERE IS A LIST  OF VARIABLES from  dataTable1  AND LABELS FOR THOSE VARIABLES
labelFrame1   
                
 # HERE IS A LIST OF VARIABLES TO WHICH CODES HAD BEEN ASSIGNED               
codeLabelFrame1           
                
attach(dataTable1)               
# The analyses below are basic descriptions of the variables. After testing, they should be replaced.                 
        
                 
summary(as.factor(STATION))  
summary(as.factor(SOIL_T))  
summary(as.numeric(YEAR))  
summary(as.numeric(MONTH))  
summary(as.numeric(DAY))  
summary(as.numeric(TIME))  
summary(as.numeric(PPT))  
summary(as.numeric(AVG_T))  
summary(as.numeric(MIN_T))  
summary(as.numeric(MAX_T))  
summary(as.numeric(AVG_RH))  
summary(as.numeric(MIN_RH))  
summary(as.numeric(MAX_RH))  
summary(as.numeric(AVG_WS))  
summary(as.numeric(AVG_WANG))  
summary(as.numeric(STD_WANG))  
summary(as.numeric(RAD_SOL))  
summary(as.numeric(PAR))