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.47.5 Cataloging System:VCR.
# Data set title: Morphometry of Atlantic Barrier Islands, Lagoons and Marshes.
# Data set creator: Dr. Bruce Hayden -  
#  Metadata Provider:    - Virginia Coast Reserve Long-Term Ecological Research Project 
#  Contact: Dr. Bruce Hayden -    - bph@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(
                    "NAME",     
                    "LENGTH",     
                    "LAGOON_AREA",     
                    "MARSH_PERCENT",     
                    "COMPLEXITY",     
                    "MEAN_DIST",     
                    "MAX_DIST",     
                    "MIN_DIST",     
                    "MAX_DEPTH",     
                    "FRINGE",     
                    "SCATTTERED",     
                    "CONTINUOUS",     
                    "NORTH_END",     
                    "SOUTH_END",     
                    "Area_Marsh_land",     
                    "TOTAL_AREA",     
                    "MARSH_LAND_PERCENT",     
                    "NUM_MARGINS"    ), check.names=TRUE)

               

 
tmp_var <- character()
tmp_label <- character()
                       tmp_var <- c(tmp_var , "NAME") 
                       tmp_label <- c(tmp_label , "Name of the barrier island reach- ")
                       tmp_var <- c(tmp_var , "LENGTH") 
                       tmp_label <- c(tmp_label , "Length of the barrier island- km")
                       tmp_var <- c(tmp_var , "LAGOON_AREA") 
                       tmp_label <- c(tmp_label , "Lagoon area behind island- km^2")
                       tmp_var <- c(tmp_var , "MARSH_PERCENT") 
                       tmp_label <- c(tmp_label , "% of lagoon surface in marsh- %")
                       tmp_var <- c(tmp_var , "COMPLEXITY") 
                       tmp_label <- c(tmp_label , "Marsh complexity- none")
                       tmp_var <- c(tmp_var , "MEAN_DIST") 
                       tmp_label <- c(tmp_label , "Mean distance from barrier island to mainland
- km")
                       tmp_var <- c(tmp_var , "MAX_DIST") 
                       tmp_label <- c(tmp_label , "Maximum distance from barrier island to mainland- km")
                       tmp_var <- c(tmp_var , "MIN_DIST") 
                       tmp_label <- c(tmp_label , "Minimum distance from barrier island to mainland- km")
                       tmp_var <- c(tmp_var , "MAX_DEPTH") 
                       tmp_label <- c(tmp_label , "Maximu water depth of the lagoon- m")
                       tmp_var <- c(tmp_var , "FRINGE") 
                       tmp_label <- c(tmp_label , "Presence of fringe marsh- ")
                       tmp_var <- c(tmp_var , "SCATTTERED") 
                       tmp_label <- c(tmp_label , "Presence of scattered marsh in lagoon- ")
                       tmp_var <- c(tmp_var , "CONTINUOUS") 
                       tmp_label <- c(tmp_label , "Presence of continuous marsh from island to mainland1- ")
                       tmp_var <- c(tmp_var , "NORTH_END") 
                       tmp_label <- c(tmp_label , "Coordinate for North end of island- km")
                       tmp_var <- c(tmp_var , "SOUTH_END") 
                       tmp_label <- c(tmp_label , "Coordinate for South end of island- km")
                       tmp_var <- c(tmp_var , "Area_Marsh_land") 
                       tmp_label <- c(tmp_label , "Area of marsh and land in lagoon- km^2")
                       tmp_var <- c(tmp_var , "TOTAL_AREA") 
                       tmp_label <- c(tmp_label , "Total area behind barrier island- km^2")
                       tmp_var <- c(tmp_var , "MARSH_LAND_PERCENT") 
                       tmp_label <- c(tmp_label , "% of marsh + land in lagoon- %")
                       tmp_var <- c(tmp_var , "NUM_MARGINS") 
                       tmp_label <- c(tmp_label , "# of land-water margins crossed
- none")
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,"FRINGE")   
tmp_code <- c(tmp_code,"0")   
tmp_label <- c(tmp_label,"does not occur")  
tmp_var <- c(tmp_var,"FRINGE")   
tmp_code <- c(tmp_code,"1")   
tmp_label <- c(tmp_label,"did occur")  
tmp_var <- c(tmp_var,"SCATTTERED")   
tmp_code <- c(tmp_code,"0")   
tmp_label <- c(tmp_label,"did not occur")  
tmp_var <- c(tmp_var,"SCATTTERED")   
tmp_code <- c(tmp_code,"1")   
tmp_label <- c(tmp_label,"did occur")  
tmp_var <- c(tmp_var,"CONTINUOUS")   
tmp_code <- c(tmp_code,"0")   
tmp_label <- c(tmp_label,"did not occur")  
tmp_var <- c(tmp_var,"CONTINUOUS")   
tmp_code <- c(tmp_code,"1")   
tmp_label <- c(tmp_label,"did occur")  
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(NAME))  
summary(as.factor(FRINGE))  
summary(as.factor(SCATTTERED))  
summary(as.factor(CONTINUOUS))  
summary(as.numeric(LENGTH))  
summary(as.numeric(LAGOON_AREA))  
summary(as.numeric(MARSH_PERCENT))  
summary(as.numeric(COMPLEXITY))  
summary(as.numeric(MEAN_DIST))  
summary(as.numeric(MAX_DIST))  
summary(as.numeric(MIN_DIST))  
summary(as.numeric(MAX_DEPTH))  
summary(as.numeric(NORTH_END))  
summary(as.numeric(SOUTH_END))  
summary(as.numeric(Area_Marsh_land))  
summary(as.numeric(TOTAL_AREA))  
summary(as.numeric(MARSH_LAND_PERCENT))  
summary(as.numeric(NUM_MARGINS))