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.27.4 Cataloging System:VCR.
# Data set title: Temporal and spatial distribution of microbial biomass, growth and activity. 1988-90..
# Data set creator: Dr. Aaron Mills -  
# Data set creator: Dr. Aaron Mills -  
#  Metadata Provider:    - Virginia Coast Reserve Long-Term Ecological Research Project 
#  Contact: Dr. Aaron Mills -    - amills@virginia.edu
#  Contact: Dr. Aaron Mills -    - amills@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") 

tmp_format <- character()
tmp_format <- c(tmp_format,"2X")
tmp_format <- c(tmp_format,"F2") 
tmp_format <- c(tmp_format,"F2") 
tmp_format <- c(tmp_format,"F2") 
tmp_format <- c(tmp_format,"1X")
tmp_format <- c(tmp_format,"A3") 
tmp_format <- c(tmp_format,"13X")
tmp_format <- c(tmp_format,"F1") 
tmp_format <- c(tmp_format,"1X") F  
tmp_format <- c(tmp_format,"8X")
tmp_format <- c(tmp_format,"F1") 
tmp_format <- c(tmp_format,"1X") F    
 tmp_format        
tmp_cols <- c(
                        "YEAR",   
                        "MONTH",   
                        "DAY",   
                        "SITEID",   
                        "WATSAMP",   
                        "WATAO",   
                        "SEDSAMP",   
                        "SEDAO")
# This creates a data.frame named:  dataTable1     
    dataTable1 <-read.fortran(infile1,tmp_format, col.names=tmp_cols, check.names=TRUE,na.strings=c("NA","."))
rm(tmp_format, tmp_cols)
    
               

 
tmp_var <- character()
tmp_label <- character()
                       tmp_var <- c(tmp_var , "YEAR") 
                       tmp_label <- c(tmp_label , "Year- YY")
                       tmp_var <- c(tmp_var , "MONTH") 
                       tmp_label <- c(tmp_label , "Month- MM")
                       tmp_var <- c(tmp_var , "DAY") 
                       tmp_label <- c(tmp_label , "Day- DD")
                       tmp_var <- c(tmp_var , "SITEID") 
                       tmp_label <- c(tmp_label , "CODE FOR STATION NAME IMPLICIT LOCATION- ")
                       tmp_var <- c(tmp_var , "WATSAMP") 
                       tmp_label <- c(tmp_label , "ID NUMBER OF REPLICATE WATER SAMPLES COLLECTED IN STATION- none")
                       tmp_var <- c(tmp_var , "WATAO") 
                       tmp_label <- c(tmp_label , "NUMBER OF BACTERIAL CELLS PER ML WATER- CELLS/ML")
                       tmp_var <- c(tmp_var , "SEDSAMP") 
                       tmp_label <- c(tmp_label , "ID NUMBER OF REPLICATE SEDIMENT SAMPLE- none")
                       tmp_var <- c(tmp_var , "SEDAO") 
                       tmp_label <- c(tmp_label , "NUMBER OF BACTERIAL CELLS/ML WET SEDIMENT- CELLS/ML")
labelFrame1<-data.frame(variable=tmp_var, label=tmp_label)
rm(tmp_var, tmp_label)        
 

tmp_var <- character()
tmp_code <- character()                
tmp_label <- character() 
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(SITEID))  
summary(as.numeric(YEAR))  
summary(as.numeric(MONTH))  
summary(as.numeric(DAY))  
summary(as.numeric(WATSAMP))  
summary(as.numeric(WATAO))  
summary(as.numeric(SEDSAMP))  
summary(as.numeric(SEDAO))