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.148.5 Cataloging System:VCR.
# Data set title: Surface Elevation  Data for the Virginia Coast Reserve.
# Data set creator: Dr. Linda Blum -  
# Data set creator: Dr. Robert Christian -  
# Data set creator:  Mark Brinson -  
# Data set creator: Ms. Patricia Willis -  
#  Metadata Provider:    - Virginia Coast Reserve Long-Term Ecological Research Project 
#  Contact: Dr. Linda Blum -    - lkb2e@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="\t"  
                ,quot='"' 
        , col.names=c(
                    "DATE",     
                    "SITE",     
                    "LEVEL",     
                    "DATATYPE",     
                    "COMMENTS"    ), check.names=TRUE)

               

 
tmp_var <- character()
tmp_label <- character()
                       tmp_var <- c(tmp_var , "DATE") 
                       tmp_label <- c(tmp_label , "Date of measurement- ")
                       tmp_var <- c(tmp_var , "SITE") 
                       tmp_label <- c(tmp_label , "Site Identifier- ")
                       tmp_var <- c(tmp_var , "LEVEL") 
                       tmp_label <- c(tmp_label , "Change in elevation of sediment surface from initial measurement- cm")
                       tmp_var <- c(tmp_var , "DATATYPE") 
                       tmp_label <- c(tmp_label , "Method of Measurement- ")
                       tmp_var <- c(tmp_var , "COMMENTS") 
                       tmp_label <- c(tmp_label , "Comments on data collection- ")
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,"DATATYPE")   
tmp_code <- c(tmp_code,"MH")   
tmp_label <- c(tmp_label,"Marker Horizon")  
tmp_var <- c(tmp_var,"DATATYPE")   
tmp_code <- c(tmp_code,"RSET")   
tmp_label <- c(tmp_label,"Root Sediment Elevation Table")  
tmp_var <- c(tmp_var,"DATATYPE")   
tmp_code <- c(tmp_code,"SET")   
tmp_label <- c(tmp_label,"Sediment Elevation Table")  
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(DATE))  
summary(as.factor(SITE))  
summary(as.factor(DATATYPE))  
summary(as.factor(COMMENTS))  
summary(as.numeric(LEVEL))