To use this program, follow these steps:
# Package ID: knb-lter-vcr.17.3 Cataloging System:VCR.
# Data set title: A study of water quality conditions in the tidal creeks of Northampton County, Vs.
# Data set creator: Luis Lagera -
# Metadata Provider: - Virginia Coast Reserve Long-Term Ecological Research Project
# Contact: Dr Luis Lagera - -
# 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,"4X")
tmp_format <- c(tmp_format,"A8")
tmp_format <- c(tmp_format,"2X")
tmp_format <- c(tmp_format,"A5")
tmp_format <- c(tmp_format,"1X")
tmp_format <- c(tmp_format,"A3")
tmp_format <- c(tmp_format,"4X")
tmp_format <- c(tmp_format,"F2")
tmp_format <- c(tmp_format,"1X") F
tmp_format <- c(tmp_format,"4X") F
tmp_format <- c(tmp_format,"1X") F
tmp_format <- c(tmp_format,"2X") F
tmp_format <- c(tmp_format,"4X") F
tmp_format <- c(tmp_format,"2X") F
tmp_format <- c(tmp_format,"2X") F
tmp_format <- c(tmp_format,"1X") F
tmp_format <- c(tmp_format,"2X") F
tmp_format <- c(tmp_format,"2X") F
tmp_format <- c(tmp_format,"4X") F
tmp_format <- c(tmp_format,"1X") F
tmp_format
tmp_cols <- c(
"DATE",
"TIME",
"SITEID",
"REPC",
"NH4",
"NO2",
"NOX",
"TIN",
"PO4",
"CHLA",
"PHAE",
"TSSW",
"TSSM",
"TSSO",
"TSSOPER",
"BOD5")
# 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 , "DATE")
tmp_label <- c(tmp_label , "date when measurements were taken- ")
tmp_var <- c(tmp_var , "TIME")
tmp_label <- c(tmp_label , "time when measurements were taken- ")
tmp_var <- c(tmp_var , "SITEID")
tmp_label <- c(tmp_label , "site/station when measurements where taken- ")
tmp_var <- c(tmp_var , "REPC")
tmp_label <- c(tmp_label , "sample replicate number- ")
tmp_var <- c(tmp_var , "NH4")
tmp_label <- c(tmp_label , "dissolved ammonium concentration- umoles/lit")
tmp_var <- c(tmp_var , "NO2")
tmp_label <- c(tmp_label , "nitrite concentration- umoles/lit")
tmp_var <- c(tmp_var , "NOX")
tmp_label <- c(tmp_label , "nitrite plus nitrate concentration- umoles/lit")
tmp_var <- c(tmp_var , "TIN")
tmp_label <- c(tmp_label , "total inorganic nitrogen- umoles/lit")
tmp_var <- c(tmp_var , "PO4")
tmp_label <- c(tmp_label , "dissolved phosphate concentration (orthophosphate)- umoles/lit")
tmp_var <- c(tmp_var , "CHLA")
tmp_label <- c(tmp_label , "chllrophyll a concentration- ug/l")
tmp_var <- c(tmp_var , "PHAE")
tmp_label <- c(tmp_label , "phaeophytin concentration- ug/l")
tmp_var <- c(tmp_var , "TSSW")
tmp_label <- c(tmp_label , "total suspended solids (whole fractions)- mg/l")
tmp_var <- c(tmp_var , "TSSM")
tmp_label <- c(tmp_label , "total suspended solids (mineral fraction)- mg/l")
tmp_var <- c(tmp_var , "TSSO")
tmp_label <- c(tmp_label , "total suspended solids (organic fraction)- mg/l")
tmp_var <- c(tmp_var , "TSSOPER")
tmp_label <- c(tmp_label , "total suspended solids (organic fraction as % of TSSW)- %")
tmp_var <- c(tmp_var , "BOD5")
tmp_label <- c(tmp_label , "biochemical oxygen demand- mg/l")
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(DATE))
summary(as.factor(TIME))
summary(as.factor(SITEID))
summary(as.factor(REPC))
summary(as.numeric(NH4))
summary(as.numeric(NO2))
summary(as.numeric(NOX))
summary(as.numeric(TIN))
summary(as.numeric(PO4))
summary(as.numeric(CHLA))
summary(as.numeric(PHAE))
summary(as.numeric(TSSW))
summary(as.numeric(TSSM))
summary(as.numeric(TSSO))
summary(as.numeric(TSSOPER))
summary(as.numeric(BOD5))